Class: Marc4R::Record::Leader

Inherits:
Object
  • Object
show all
Defined in:
lib/marc4r/record.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_schemeObject

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_addressObject

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_mapObject

Returns the value of attribute entry_map.



38
39
40
# File 'lib/marc4r/record.rb', line 38

def entry_map
  @entry_map
end

#idObject

Returns the value of attribute id.



38
39
40
# File 'lib/marc4r/record.rb', line 38

def id
  @id
end

#impl_defined1Object

Returns the value of attribute impl_defined1.



38
39
40
# File 'lib/marc4r/record.rb', line 38

def impl_defined1
  @impl_defined1
end

#impl_defined2Object

Returns the value of attribute impl_defined2.



38
39
40
# File 'lib/marc4r/record.rb', line 38

def impl_defined2
  @impl_defined2
end

#indicator_countObject

Returns the value of attribute indicator_count.



38
39
40
# File 'lib/marc4r/record.rb', line 38

def indicator_count
  @indicator_count
end

#record_lengthObject

Returns the value of attribute record_length.



38
39
40
# File 'lib/marc4r/record.rb', line 38

def record_length
  @record_length
end

#record_statusObject

Returns the value of attribute record_status.



38
39
40
# File 'lib/marc4r/record.rb', line 38

def record_status
  @record_status
end

#record_typeObject

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_countObject

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

Returns:

  • (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_sObject



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