Class: RelatonBib::BibliographicItem::Version

Inherits:
Object
  • Object
show all
Defined in:
lib/relaton_bib/biblio_version.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(revision_date = nil, draft = []) ⇒ Version

Returns a new instance of Version.

Parameters:

  • revision_date (String) (defaults to: nil)
  • draft (Array<String>) (defaults to: [])


22
23
24
25
# File 'lib/relaton_bib/biblio_version.rb', line 22

def initialize(revision_date = nil, draft = [])
  @revision_date = revision_date
  @draft         = draft
end

Instance Attribute Details

#draftArray<String> (readonly)

Returns:

  • (Array<String>)


18
19
20
# File 'lib/relaton_bib/biblio_version.rb', line 18

def draft
  @draft
end

#revision_dateString (readonly)

Returns:

  • (String)


15
16
17
# File 'lib/relaton_bib/biblio_version.rb', line 15

def revision_date
  @revision_date
end

Instance Method Details

#to_xml(builder) ⇒ Object

Parameters:

  • builder (Nokogiri::XML::Builder)


28
29
30
31
32
33
# File 'lib/relaton_bib/biblio_version.rb', line 28

def to_xml(builder)
  builder.version do
    builder.revision_date revision_date if revision_date
    draft.each { |d| builder.draft d }
  end
end