Class: PacerApi::RequestTranslator

Inherits:
Object
  • Object
show all
Defined in:
lib/pacer_api/request_translator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.translate(obj) ⇒ Object



7
8
9
# File 'lib/pacer_api/request_translator.rb', line 7

def self.translate(obj)
  new.translate(obj)
end

Instance Method Details

#translate(obj) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/pacer_api/request_translator.rb', line 11

def translate(obj)
  case obj
  when Array then translate_array(obj)
  when Date  then translate_date(obj)
  when Hash  then translate_hash(obj)
  else            obj
  end
end