Class: RelatonBib::EditorialGroup

Inherits:
Object
  • Object
show all
Includes:
RelatonBib
Defined in:
lib/relaton_bib/editorial_group.rb

Constant Summary

Constants included from RelatonBib

VERSION

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from RelatonBib

array, format_date, grammar_hash, parse_date, parse_yaml

Methods included from Config

#configuration, #configure

Constructor Details

#initialize(technical_committee) ⇒ EditorialGroup

Returns a new instance of EditorialGroup.

Parameters:



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

def initialize(technical_committee)
  @technical_committee = technical_committee
end

Instance Attribute Details

#technical_committeeArray<RelatonBib::TechnicalCommittee>



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

def technical_committee
  @technical_committee
end

Instance Method Details

#presence?true

Returns:

  • (true)


37
38
39
# File 'lib/relaton_bib/editorial_group.rb', line 37

def presence?
  technical_committee.any?
end

#to_asciibib(prefix = "") ⇒ String

Parameters:

  • prefix (String) (defaults to: "")

Returns:

  • (String)


29
30
31
32
33
34
# File 'lib/relaton_bib/editorial_group.rb', line 29

def to_asciibib(prefix = "")
  pref = prefix.empty? ? "editorialgroup" : "#{prefix}.editorialgroup"
  technical_committee.map do |tc|
    tc.to_asciibib pref, technical_committee.size
  end.join
end

#to_hashHash

Returns:

  • (Hash)


23
24
25
# File 'lib/relaton_bib/editorial_group.rb', line 23

def to_hash
  single_element_array technical_committee
end

#to_xml(builder) ⇒ Object

Parameters:

  • builder (Nokogigi::XML::Builder)


16
17
18
19
20
# File 'lib/relaton_bib/editorial_group.rb', line 16

def to_xml(builder)
  builder.editorialgroup do |b|
    technical_committee.each { |tc| tc.to_xml b }
  end
end