Module: GMO::PG::Payload::Typecast

Defined in:
lib/gmo-pg/http_resource/payload/typecast.rb

Class Method Summary collapse

Class Method Details

.detect(typecast_option) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/gmo-pg/http_resource/payload/typecast.rb', line 5

def self.detect(typecast_option)
  case typecast_option
  when /\Ainteger\z/    then TypecastableInteger
  when /\Aepoch_time\Z/ then TypecastableEpochTime
  when Hash             then TypecastableValue.from_hash(typecast_option)
  else TypecastableValue
  end
end