Class: Marcxella::SubField
- Inherits:
-
Object
- Object
- Marcxella::SubField
- Defined in:
- lib/marcxella/subfield.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(node) ⇒ SubField
constructor
A new instance of SubField.
- #to_s ⇒ Object
Constructor Details
#initialize(node) ⇒ SubField
Returns a new instance of SubField.
4 5 6 7 |
# File 'lib/marcxella/subfield.rb', line 4 def initialize(node) @code = node['code'] @value = node.text end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
3 4 5 |
# File 'lib/marcxella/subfield.rb', line 3 def code @code end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
3 4 5 |
# File 'lib/marcxella/subfield.rb', line 3 def value @value end |
Instance Method Details
#to_s ⇒ Object
9 10 11 |
# File 'lib/marcxella/subfield.rb', line 9 def to_s "$%s%s" % [@code, @value] end |