Class: GMO::PG::Payload::TypecastableInteger

Inherits:
TypecastableValue show all
Defined in:
lib/gmo-pg/http_resource/payload/typecast.rb

Direct Known Subclasses

TypecastableEpochTime

Instance Attribute Summary

Attributes inherited from TypecastableValue

#value

Instance Method Summary collapse

Methods inherited from TypecastableValue

#==, from_hash, #initialize

Constructor Details

This class inherits a constructor from GMO::PG::Payload::TypecastableValue

Instance Method Details

#to_attributeObject



51
52
53
# File 'lib/gmo-pg/http_resource/payload/typecast.rb', line 51

def to_attribute
  @value.respond_to?(:to_i) ? @value.to_i : @value
end

#to_payloadObject



55
56
57
# File 'lib/gmo-pg/http_resource/payload/typecast.rb', line 55

def to_payload
  to_attribute.to_s
end