Class: RelatonUn::EditorialGroup
- Inherits:
-
Object
- Object
- RelatonUn::EditorialGroup
- Includes:
- RelatonBib
- Defined in:
- lib/relaton_un/editorialgroup.rb
Instance Attribute Summary collapse
- #committee ⇒ Array<String> readonly
Instance Method Summary collapse
-
#initialize(committee) ⇒ EditorialGroup
constructor
A new instance of EditorialGroup.
- #presence? ⇒ true
- #to_asciibib(prefix) ⇒ String
- #to_hash ⇒ Array<Hash>, Hash
- #to_xml(builder) ⇒ Object
Constructor Details
#initialize(committee) ⇒ EditorialGroup
Returns a new instance of EditorialGroup.
9 10 11 |
# File 'lib/relaton_un/editorialgroup.rb', line 9 def initialize(committee) @committee = committee end |
Instance Attribute Details
#committee ⇒ Array<String> (readonly)
6 7 8 |
# File 'lib/relaton_un/editorialgroup.rb', line 6 def committee @committee end |
Instance Method Details
#presence? ⇒ true
14 15 16 |
# File 'lib/relaton_un/editorialgroup.rb', line 14 def presence? true end |
#to_asciibib(prefix) ⇒ String
32 33 34 35 36 |
# File 'lib/relaton_un/editorialgroup.rb', line 32 def to_asciibib(prefix) pref = prefix.empty? ? prefix : prefix + "." pref += "editorialgroup" committee.map { |c| "#{pref}.committee:: #{c}\n" }.join end |
#to_hash ⇒ Array<Hash>, Hash
26 27 28 |
# File 'lib/relaton_un/editorialgroup.rb', line 26 def to_hash single_element_array(committee.map { |c| { "committee" => c } }) end |
#to_xml(builder) ⇒ Object
19 20 21 22 23 |
# File 'lib/relaton_un/editorialgroup.rb', line 19 def to_xml(builder) builder.editorialgroup do |b| committee.each { |c| b.committee c } end end |