Class: RelatonIho::EditorialGroupCollection

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/relaton_iho/editorial_group.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(collection) ⇒ EditorialGroupCollection



11
12
13
# File 'lib/relaton_iho/editorial_group.rb', line 11

def initialize(collection)
  @collection = collection
end

Instance Attribute Details

#collectionArray<RelatonIho::EditorialGroup] (readonly)



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_hashHash+



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