Class: Hyrax::VersionPresenter

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(version) ⇒ VersionPresenter

Returns a new instance of VersionPresenter.


6
7
8
9
# File 'app/presenters/hyrax/version_presenter.rb', line 6

def initialize(version)
  @version = version
  @current = false
end

Instance Attribute Details

#currentObject (readonly) Also known as: current?

Returns the value of attribute current.


4
5
6
# File 'app/presenters/hyrax/version_presenter.rb', line 4

def current
  @current
end

#versionObject (readonly)

Returns the value of attribute version.


4
5
6
# File 'app/presenters/hyrax/version_presenter.rb', line 4

def version
  @version
end

Instance Method Details

#committerObject


22
23
24
25
26
# File 'app/presenters/hyrax/version_presenter.rb', line 22

def committer
  Hyrax::VersionCommitter
    .find_by(version_id: @version.uri)
    &.
end

#createdObject


18
19
20
# File 'app/presenters/hyrax/version_presenter.rb', line 18

def created
  @created ||= version.created.in_time_zone.to_formatted_s(:long_ordinal)
end

#current!Object


14
15
16
# File 'app/presenters/hyrax/version_presenter.rb', line 14

def current!
  @current = true
end