lib/intercom/user_resource.rb in intercom-0.1.4 vs lib/intercom/user_resource.rb in intercom-0.1.5
- old
+ new
@@ -61,10 +61,11 @@
def self.for_wire(object)
return object.for_wire if object.respond_to?(:for_wire)
return object.map { |item| for_wire(item) } if object.is_a?(Array)
return object.inject({}) { |result, (k, value)| result[k] = for_wire(value); result } if object.is_a?(Hash)
+ return object.to_i if object.is_a?(Time)
object
end
def self.from_api(api_response)
obj = self.new
@@ -79,6 +80,6 @@
def self.requires_parameters(parameters, required)
missing = Array(required) - parameters.keys.map(&:to_s)
raise ArgumentError.new("Missing required parameters (#{missing.join(', ')}).") unless missing.empty?
end
end
-end
\ No newline at end of file
+end