Class: Metacrunch::Mab2::Document::Subfield
- Inherits:
-
Object
- Object
- Metacrunch::Mab2::Document::Subfield
- Defined in:
- lib/metacrunch/mab2/document/subfield.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(code = nil, value = nil) ⇒ Subfield
constructor
A new instance of Subfield.
-
#to_xml(builder) ⇒ Object
—————————————————————————— Serialization ——————————————————————————.
Constructor Details
#initialize(code = nil, value = nil) ⇒ Subfield
Returns a new instance of Subfield.
9 10 11 12 |
# File 'lib/metacrunch/mab2/document/subfield.rb', line 9 def initialize(code = nil, value = nil) @code = code @value = value end |
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code.
6 7 8 |
# File 'lib/metacrunch/mab2/document/subfield.rb', line 6 def code @code end |
#value ⇒ Object
Returns the value of attribute value.
7 8 9 |
# File 'lib/metacrunch/mab2/document/subfield.rb', line 7 def value @value end |
Instance Method Details
#to_xml(builder) ⇒ Object
Serialization
18 19 20 |
# File 'lib/metacrunch/mab2/document/subfield.rb', line 18 def to_xml(builder) builder.subfield(value, code: code) end |