Class: CurationConcerns::VersionPresenter

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(version) ⇒ VersionPresenter

Returns a new instance of VersionPresenter.



5
6
7
8
# File 'app/presenters/curation_concerns/version_presenter.rb', line 5

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

Instance Attribute Details

#currentObject (readonly) Also known as: current?

Returns the value of attribute current.



3
4
5
# File 'app/presenters/curation_concerns/version_presenter.rb', line 3

def current
  @current
end

#versionObject (readonly)

Returns the value of attribute version.



3
4
5
# File 'app/presenters/curation_concerns/version_presenter.rb', line 3

def version
  @version
end

Instance Method Details

#committerObject



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

def committer
  vc = VersionCommitter.where(version_id: @version.uri)
  vc.empty? ? nil : vc.first.
end

#createdObject



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

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

#current!Object



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

def current!
  @current = true
end