Class: ProjectShowPresenter
- Inherits:
-
Object
- Object
- ProjectShowPresenter
- Defined in:
- app/presenters/project_show_presenter.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#project ⇒ Object
readonly
Returns the value of attribute project.
-
#project_metadata ⇒ Object
readonly
Returns the value of attribute project_metadata.
Instance Method Summary collapse
- #created ⇒ Object
- #data_manager ⇒ Object
- #data_sponsor ⇒ Object
-
#initialize(project) ⇒ ProjectShowPresenter
constructor
A new instance of ProjectShowPresenter.
-
#project_directory ⇒ Object
used to hide the project root that is not visible to the end user.
- #updated ⇒ Object
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
#project ⇒ Object (readonly)
Returns the value of attribute project.
6 7 8 |
# File 'app/presenters/project_show_presenter.rb', line 6 def project @project end |
#project_metadata ⇒ Object (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
#created ⇒ Object
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_manager ⇒ Object
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_sponsor ⇒ Object
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_directory ⇒ Object
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 |
#updated ⇒ Object
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 |