class Fahrenheit::Ubpb::Primo::SearchRequestFactory

Public Class Methods

new(object) click to toggle source

blog.sidu.in/2007/12/rubys-new-as-factory.html

# File lib/fahrenheit/ubpb/primo/search_request_factory.rb, line 7
def self.new(object)
  Fahrenheit::SearchRequest.new(apply_mapping(object.to_h))
end

Private Class Methods

apply_mapping(hash) click to toggle source
# File lib/fahrenheit/ubpb/primo/search_request_factory.rb, line 31
def self.apply_mapping(hash)
  alterable_hash = deep_copy_object(hash)
  apply_mapping!(alterable_hash)
  alterable_hash
end
apply_mapping!(hash) click to toggle source
# File lib/fahrenheit/ubpb/primo/search_request_factory.rb, line 37
def self.apply_mapping!(hash)
  @@search_request_mapping.apply_to(hash)
end
deep_copy_object(object) click to toggle source
# File lib/fahrenheit/ubpb/primo/search_request_factory.rb, line 41
def self.deep_copy_object(object)
  Marshal.load(Marshal.dump(object))  
end