Class: RelatonIho::EditorialGroupCollection

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
RelatonBib
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:



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

def initialize(collection)
  @collection = collection
end

Instance Attribute Details

#collectionArray<RelatonIho::editorialgroup] (readonly)

Returns Array<RelatonIho::editorialgroup].

Returns:

  • (Array<RelatonIho::editorialgroup])

    Array<RelatonIho::editorialgroup]



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

def collection
  @collection
end

Instance Method Details

#presence?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/relaton_iho/editorial_group.rb', line 27

def presence?
  any?
end

#to_hashHash

Returns:

  • (Hash)


22
23
24
# File 'lib/relaton_iho/editorial_group.rb', line 22

def to_hash
  single_element_array collection
end

#to_xml(builder) ⇒ Object

Parameters:

  • builder (Nokogiro::XML::Builder)


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

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