Class: Marc4R::Fields::Subfield
- Inherits:
-
Object
- Object
- Marc4R::Fields::Subfield
- Defined in:
- lib/marc4r/fields/subfield.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
Attributes included from Datable
Attributes included from Idable
Instance Method Summary collapse
-
#initialize(code = nil, data = nil) ⇒ Subfield
constructor
A new instance of Subfield.
- #to_s ⇒ Object
Methods included from Datable
Constructor Details
#initialize(code = nil, data = nil) ⇒ Subfield
Returns a new instance of Subfield.
5 6 7 8 |
# File 'lib/marc4r/fields/subfield.rb', line 5 def initialize(code=nil, data=nil) self.code = code if code self.data = data if data end |
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code.
4 5 6 |
# File 'lib/marc4r/fields/subfield.rb', line 4 def code @code end |
Instance Method Details
#to_s ⇒ Object
9 10 11 |
# File 'lib/marc4r/fields/subfield.rb', line 9 def to_s "#{code}#{data}" end |