Class: Alma::AlmaRecord

Inherits:
Object
  • Object
show all
Defined in:
lib/alma/alma_record.rb

Direct Known Subclasses

Fine, Library, Loan, Location, UserRequest

Instance Method Summary collapse

Constructor Details

#initialize(record) ⇒ AlmaRecord

Returns a new instance of AlmaRecord.



5
6
7
8
# File 'lib/alma/alma_record.rb', line 5

def initialize(record)
  @raw_record = record
  post_initialize()
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name) ⇒ Object



10
11
12
13
# File 'lib/alma/alma_record.rb', line 10

def method_missing(name)
  return response[name.to_s] if response.has_key?(name.to_s)
  super.method_missing name
end

Instance Method Details

#post_initializeObject



23
24
25
26
# File 'lib/alma/alma_record.rb', line 23

def post_initialize
  # Subclasses can define this method to perform extra initialization
  # after the super class init.
end

#respond_to_missing?(name, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/alma/alma_record.rb', line 15

def respond_to_missing?(name, include_private = false)
  response.has_key?(name.to_s) || super
end

#responseObject



19
20
21
# File 'lib/alma/alma_record.rb', line 19

def response
  @raw_record
end