Class: RelatonIho::EditorialGroupCollection
- Inherits:
-
Object
- Object
- RelatonIho::EditorialGroupCollection
- Extended by:
- Forwardable
- Defined in:
- lib/relaton_iho/editorial_group.rb
Instance Attribute Summary collapse
-
#collection ⇒ Array<RelatonIho::EditorialGroup]
readonly
Array<RelatonIho::EditorialGroup].
Instance Method Summary collapse
-
#initialize(collection) ⇒ EditorialGroupCollection
constructor
A new instance of EditorialGroupCollection.
- #presence? ⇒ Boolean
- #to_asciibib(prefix) ⇒ String
- #to_hash ⇒ Hash+
- #to_xml(builder) ⇒ Object
Constructor Details
#initialize(collection) ⇒ EditorialGroupCollection
Returns a new instance of EditorialGroupCollection.
11 12 13 |
# File 'lib/relaton_iho/editorial_group.rb', line 11 def initialize(collection) @collection = collection end |
Instance Attribute Details
#collection ⇒ Array<RelatonIho::EditorialGroup] (readonly)
Returns Array<RelatonIho::EditorialGroup].
8 9 10 |
# File 'lib/relaton_iho/editorial_group.rb', line 8 def collection @collection end |
Instance Method Details
#presence? ⇒ Boolean
32 33 34 |
# File 'lib/relaton_iho/editorial_group.rb', line 32 def presence? any? end |
#to_asciibib(prefix) ⇒ String
27 28 29 |
# File 'lib/relaton_iho/editorial_group.rb', line 27 def to_asciibib(prefix) collection.map { |ed| ed.to_asciibib prefix, collection.size }.join end |
#to_hash ⇒ Hash+
21 22 23 |
# File 'lib/relaton_iho/editorial_group.rb', line 21 def to_hash collection.map &:to_hash end |
#to_xml(builder) ⇒ Object
16 17 18 |
# File 'lib/relaton_iho/editorial_group.rb', line 16 def to_xml(builder) collection.each { |eg| eg.to_xml builder } end |