Class: Exlibris::Aleph::TabParser::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/exlibris/aleph/tabs_parser/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Base

Returns a new instance of Base.



9
10
11
12
13
14
15
16
17
18
# File 'lib/exlibris/aleph/tabs_parser/base.rb', line 9

def initialize(args)
  @aleph_library = args[:aleph_library]
  @aleph_library.downcase!
  @aleph_file_name = args[:aleph_file_name]
  @aleph_file_name.downcase!
  @pattern = args[:pattern]
  @pattern_key = args[:pattern_key]
  @hash_key = args[:hash_key]
  @aleph_file = "#{args[:aleph_mnt_path]}/#{@aleph_library}/tab/#{@aleph_file_name}"
end

Instance Attribute Details

#config_arrayObject

Returns the value of attribute config_array.



7
8
9
# File 'lib/exlibris/aleph/tabs_parser/base.rb', line 7

def config_array
  @config_array
end

#config_hashObject

Returns the value of attribute config_hash.



7
8
9
# File 'lib/exlibris/aleph/tabs_parser/base.rb', line 7

def config_hash
  @config_hash
end

#file_nameObject

Returns the value of attribute file_name.



5
6
7
# File 'lib/exlibris/aleph/tabs_parser/base.rb', line 5

def file_name
  @file_name
end

#hash_keyObject

Returns the value of attribute hash_key.



7
8
9
# File 'lib/exlibris/aleph/tabs_parser/base.rb', line 7

def hash_key
  @hash_key
end

#libraryObject

Returns the value of attribute library.



5
6
7
# File 'lib/exlibris/aleph/tabs_parser/base.rb', line 5

def library
  @library
end

#local_fileObject

Returns the value of attribute local_file.



6
7
8
# File 'lib/exlibris/aleph/tabs_parser/base.rb', line 6

def local_file
  @local_file
end

#local_pathObject

Returns the value of attribute local_path.



6
7
8
# File 'lib/exlibris/aleph/tabs_parser/base.rb', line 6

def local_path
  @local_path
end

#patternObject

Returns the value of attribute pattern.



5
6
7
# File 'lib/exlibris/aleph/tabs_parser/base.rb', line 5

def pattern
  @pattern
end

#pattern_keyObject

Returns the value of attribute pattern_key.



5
6
7
# File 'lib/exlibris/aleph/tabs_parser/base.rb', line 5

def pattern_key
  @pattern_key
end

Instance Method Details

#to_aObject



20
21
22
# File 'lib/exlibris/aleph/tabs_parser/base.rb', line 20

def to_a
  @config_array ||= parse_file.first
end

#to_hObject



24
25
26
# File 'lib/exlibris/aleph/tabs_parser/base.rb', line 24

def to_h
  @config_hash ||= parse_file.last
end