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

Returns a new instance of EditorialGroupCollection.

Parameters:



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)

Returns Array<RelatonIho::EditorialGroup].

Returns:



8
9
10
# File 'lib/relaton_iho/editorial_group.rb', line 8

def collection
  @collection
end

Instance Method Details

#presence?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/relaton_iho/editorial_group.rb', line 32

def presence?
  any?
end

#to_asciibib(prefix) ⇒ String

Parameters:

  • prefix (String)

Returns:

  • (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+

Returns:

  • (Hash, Array<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

Parameters:

  • builder (Nokogiro::XML::Builder)


16
17
18
# File 'lib/relaton_iho/editorial_group.rb', line 16

def to_xml(builder)
  collection.each { |eg| eg.to_xml builder }
end