Class: Marcxella::SubField

Inherits:
Object
  • Object
show all
Defined in:
lib/marcxella/subfield.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#codeObject (readonly)

Returns the value of attribute code.



3
4
5
# File 'lib/marcxella/subfield.rb', line 3

def code
  @code
end

#valueObject (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_sObject



9
10
11
# File 'lib/marcxella/subfield.rb', line 9

def to_s
  "$%s%s" % [@code, @value]
end