Class: RelatonOgc::EditorialGroup
- Inherits:
-
Object
- Object
- RelatonOgc::EditorialGroup
- Includes:
- RelatonBib
- Defined in:
- lib/relaton_ogc/editorial_group.rb
Overview
OGC project group.
Constant Summary collapse
- COMMITTEES =
%w[technical planning strategic-member-advisory].freeze
Instance Attribute Summary collapse
- #committee ⇒ String readonly
- #subcommittee ⇒ RelatonIsoBib::IsoSubgroup readonly
- #workgroup ⇒ RelatonIsoBib::IsoSubgroup readonly
Instance Method Summary collapse
-
#initialize(committee:, **args) ⇒ EditorialGroup
constructor
A new instance of EditorialGroup.
- #to_hash ⇒ Hash
- #to_xml(builder) ⇒ Object
Constructor Details
#initialize(committee:, **args) ⇒ EditorialGroup
Returns a new instance of EditorialGroup.
28 29 30 31 32 33 34 35 36 |
# File 'lib/relaton_ogc/editorial_group.rb', line 28 def initialize(committee:, **args) unless COMMITTEES.include? committee raise ArgumentError, "committee is invalid: #{committee}" end @committee = committee @subcommittee = subgroup args[:subcommittee] @workgroup = subgroup args[:workgroup] end |
Instance Attribute Details
#committee ⇒ String (readonly)
9 10 11 |
# File 'lib/relaton_ogc/editorial_group.rb', line 9 def committee @committee end |
#subcommittee ⇒ RelatonIsoBib::IsoSubgroup (readonly)
12 13 14 |
# File 'lib/relaton_ogc/editorial_group.rb', line 12 def subcommittee @subcommittee end |
#workgroup ⇒ RelatonIsoBib::IsoSubgroup (readonly)
15 16 17 |
# File 'lib/relaton_ogc/editorial_group.rb', line 15 def workgroup @workgroup end |
Instance Method Details
#to_hash ⇒ Hash
48 49 50 51 52 53 |
# File 'lib/relaton_ogc/editorial_group.rb', line 48 def to_hash hash = { "committee" => committee } hash["subcommittee"] = subcommittee.to_hash if subcommittee hash["workgroup"] = workgroup.to_hash if workgroup hash end |
#to_xml(builder) ⇒ Object
39 40 41 42 43 44 45 |
# File 'lib/relaton_ogc/editorial_group.rb', line 39 def to_xml(builder) builder.editorialgroup do builder.committee committee builder.subcommittee { subcommittee&.to_xml builder } if subcommittee builder.workgroup { workgroup&.to_xml builder } if workgroup end end |