Class: Sufia::VersionPresenter
- Inherits:
-
Object
- Object
- Sufia::VersionPresenter
- Defined in:
- app/presenters/sufia/version_presenter.rb
Instance Attribute Summary collapse
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
- #committer ⇒ Object
- #created ⇒ Object
- #current! ⇒ Object
- #current? ⇒ Boolean
-
#initialize(version) ⇒ VersionPresenter
constructor
A new instance of VersionPresenter.
Constructor Details
#initialize(version) ⇒ VersionPresenter
Returns a new instance of VersionPresenter.
5 6 7 8 |
# File 'app/presenters/sufia/version_presenter.rb', line 5 def initialize(version) @version = version @current = false end |
Instance Attribute Details
#version ⇒ Object (readonly)
Returns the value of attribute version.
3 4 5 |
# File 'app/presenters/sufia/version_presenter.rb', line 3 def version @version end |
Instance Method Details
#committer ⇒ Object
25 26 27 28 |
# File 'app/presenters/sufia/version_presenter.rb', line 25 def committer vc = VersionCommitter.where(version_id: @version.uri) return vc.empty? ? nil : vc.first.committer_login end |
#created ⇒ Object
20 21 22 23 |
# File 'app/presenters/sufia/version_presenter.rb', line 20 def created @created ||= version.created.to_time.to_formatted_s(:long_ordinal) @created end |
#current! ⇒ Object
12 13 14 |
# File 'app/presenters/sufia/version_presenter.rb', line 12 def current! @current = true end |
#current? ⇒ Boolean
16 17 18 |
# File 'app/presenters/sufia/version_presenter.rb', line 16 def current? @current end |