Class: RelatonBib::ICS
Instance Attribute Summary collapse
- #code ⇒ String readonly
- #text ⇒ String readonly
Instance Method Summary collapse
-
#initialize(code:, text:) ⇒ ICS
constructor
A new instance of ICS.
- #to_hash ⇒ Hash
- #to_xml(builder) ⇒ Object
Constructor Details
#initialize(code:, text:) ⇒ ICS
Returns a new instance of ICS.
8 9 10 11 |
# File 'lib/relaton_bib/ics.rb', line 8 def initialize(code:, text:) @code = code @text = text end |
Instance Attribute Details
#code ⇒ String (readonly)
4 5 6 |
# File 'lib/relaton_bib/ics.rb', line 4 def code @code end |
#text ⇒ String (readonly)
4 5 6 |
# File 'lib/relaton_bib/ics.rb', line 4 def text @text end |
Instance Method Details
#to_hash ⇒ Hash
22 23 24 |
# File 'lib/relaton_bib/ics.rb', line 22 def to_hash { "code" => code, "text" => text } end |
#to_xml(builder) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/relaton_bib/ics.rb', line 14 def to_xml(builder) builder.ics do |b| b.code code b.text_ text end end |