Class: Marc4R::Record::Leader
- Inherits:
-
Object
- Object
- Marc4R::Record::Leader
- Defined in:
- lib/marc4r/record.rb
Instance Attribute Summary collapse
-
#char_coding_scheme ⇒ Object
Returns the value of attribute char_coding_scheme.
-
#data_base_address ⇒ Object
Returns the value of attribute data_base_address.
-
#entry_map ⇒ Object
Returns the value of attribute entry_map.
-
#id ⇒ Object
Returns the value of attribute id.
-
#impl_defined1 ⇒ Object
Returns the value of attribute impl_defined1.
-
#impl_defined2 ⇒ Object
Returns the value of attribute impl_defined2.
-
#indicator_count ⇒ Object
Returns the value of attribute indicator_count.
-
#record_length ⇒ Object
Returns the value of attribute record_length.
-
#record_status ⇒ Object
Returns the value of attribute record_status.
-
#record_type ⇒ Object
Returns the value of attribute record_type.
-
#subfield_code_count ⇒ Object
Returns the value of attribute subfield_code_count.
Instance Method Summary collapse
- #eql?(x) ⇒ Boolean
-
#initialize(value = nil) ⇒ Leader
constructor
A new instance of Leader.
- #to_s ⇒ Object
Constructor Details
#initialize(value = nil) ⇒ Leader
Returns a new instance of Leader.
42 43 44 |
# File 'lib/marc4r/record.rb', line 42 def initialize(value = nil) parse(value) if value end |
Instance Attribute Details
#char_coding_scheme ⇒ Object
Returns the value of attribute char_coding_scheme.
38 39 40 |
# File 'lib/marc4r/record.rb', line 38 def char_coding_scheme @char_coding_scheme end |
#data_base_address ⇒ Object
Returns the value of attribute data_base_address.
38 39 40 |
# File 'lib/marc4r/record.rb', line 38 def data_base_address @data_base_address end |
#entry_map ⇒ Object
Returns the value of attribute entry_map.
38 39 40 |
# File 'lib/marc4r/record.rb', line 38 def entry_map @entry_map end |
#id ⇒ Object
Returns the value of attribute id.
38 39 40 |
# File 'lib/marc4r/record.rb', line 38 def id @id end |
#impl_defined1 ⇒ Object
Returns the value of attribute impl_defined1.
38 39 40 |
# File 'lib/marc4r/record.rb', line 38 def impl_defined1 @impl_defined1 end |
#impl_defined2 ⇒ Object
Returns the value of attribute impl_defined2.
38 39 40 |
# File 'lib/marc4r/record.rb', line 38 def impl_defined2 @impl_defined2 end |
#indicator_count ⇒ Object
Returns the value of attribute indicator_count.
38 39 40 |
# File 'lib/marc4r/record.rb', line 38 def indicator_count @indicator_count end |
#record_length ⇒ Object
Returns the value of attribute record_length.
38 39 40 |
# File 'lib/marc4r/record.rb', line 38 def record_length @record_length end |
#record_status ⇒ Object
Returns the value of attribute record_status.
38 39 40 |
# File 'lib/marc4r/record.rb', line 38 def record_status @record_status end |
#record_type ⇒ Object
Returns the value of attribute record_type.
38 39 40 |
# File 'lib/marc4r/record.rb', line 38 def record_type @record_type end |
#subfield_code_count ⇒ Object
Returns the value of attribute subfield_code_count.
38 39 40 |
# File 'lib/marc4r/record.rb', line 38 def subfield_code_count @subfield_code_count end |
Instance Method Details
#eql?(x) ⇒ Boolean
45 46 47 |
# File 'lib/marc4r/record.rb', line 45 def eql? x (x.is_a? Marc4R::Record::Leader) && self.to_s.eql?(x.to_s) end |
#to_s ⇒ Object
78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/marc4r/record.rb', line 78 def to_s strings = @record_length ? [zero_pad(@record_length,5)] : [] strings << @record_status if @record_status strings << @record_type if @record_type strings += @impl_defined1 if @impl_defined1 strings << @char_coding_scheme if @char_coding_scheme strings << @indicator_count.to_s if @indicator_count strings << @subfield_code_count.to_s if @subfield_code_count strings << zero_pad(@data_base_address,5) if @data_base_address strings += @impl_defined2 if @impl_defined2 strings += @entry_map if @entry_map strings.join('') end |