Class: RelatonIho::EditorialGroup
- Inherits:
-
Object
- Object
- RelatonIho::EditorialGroup
- Defined in:
- lib/relaton_iho/editorial_group.rb
Instance Attribute Summary collapse
- #committee ⇒ String readonly
- #workgroup ⇒ String? readonly
Instance Method Summary collapse
-
#initialize(committee:, workgroup: nil) ⇒ EditorialGroup
constructor
A new instance of EditorialGroup.
- #to_hash ⇒ Hash
- #to_xml(builder) ⇒ Object
Constructor Details
#initialize(committee:, workgroup: nil) ⇒ EditorialGroup
Returns a new instance of EditorialGroup.
41 42 43 44 45 46 47 |
# File 'lib/relaton_iho/editorial_group.rb', line 41 def initialize(committee:, workgroup: nil) unless %[hssc ircc council ihr bureau imo msc dcdb].include? committee.downcase warn "[relaton-iho] WARNING: invalid committee: #{committee}" end @committee = committee @workgroup = workgroup end |
Instance Attribute Details
#committee ⇒ String (readonly)
34 35 36 |
# File 'lib/relaton_iho/editorial_group.rb', line 34 def committee @committee end |
#workgroup ⇒ String? (readonly)
37 38 39 |
# File 'lib/relaton_iho/editorial_group.rb', line 37 def workgroup @workgroup end |
Instance Method Details
#to_hash ⇒ Hash
58 59 60 61 62 |
# File 'lib/relaton_iho/editorial_group.rb', line 58 def to_hash hash = { "committee" => committee } hash["workgroup"] = workgroup if workgroup hash end |
#to_xml(builder) ⇒ Object
50 51 52 53 54 55 |
# File 'lib/relaton_iho/editorial_group.rb', line 50 def to_xml(builder) builder.editorialgroup do builder.committee committee builder.workgroup workgroup if workgroup end end |