Class: ProjectShowPresenter

Inherits:
Object
  • Object
show all
Defined in:
app/presenters/project_show_presenter.rb

Direct Known Subclasses

ProjectDashboardPresenter

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(project) ⇒ ProjectShowPresenter

Returns a new instance of ProjectShowPresenter.



8
9
10
11
# File 'app/presenters/project_show_presenter.rb', line 8

def initialize(project)
  @project = project
  @project_metadata = @project.
end

Instance Attribute Details

#projectObject (readonly)

Returns the value of attribute project.



6
7
8
# File 'app/presenters/project_show_presenter.rb', line 6

def project
  @project
end

#project_metadataObject (readonly)

Returns the value of attribute project_metadata.



6
7
8
# File 'app/presenters/project_show_presenter.rb', line 6

def 
  @project_metadata
end

Instance Method Details

#createdObject



13
14
15
# File 'app/presenters/project_show_presenter.rb', line 13

def created
  @project.created_at.strftime("%b %e, %Y %l:%M %p")
end

#data_managerObject



25
26
27
# File 'app/presenters/project_show_presenter.rb', line 25

def data_manager
  User.find_by(uid: @project.["data_manager"]).uid
end

#data_sponsorObject



21
22
23
# File 'app/presenters/project_show_presenter.rb', line 21

def data_sponsor
  User.find_by(uid: @project.["data_sponsor"]).uid
end

#project_directoryObject

used to hide the project root that is not visible to the end user



30
31
32
# File 'app/presenters/project_show_presenter.rb', line 30

def project_directory
  project.project_directory.gsub(Mediaflux::Connection.hidden_root, "")
end

#updatedObject



17
18
19
# File 'app/presenters/project_show_presenter.rb', line 17

def updated
  @project.updated_at.strftime("%b %e, %Y %l:%M %p")
end