Class: FacebookAds::FieldTypes::Integer

Inherits:
Base
  • Object
show all
Defined in:
lib/facebook_ads/field_types/integer.rb

Instance Method Summary collapse

Methods included from FacebookAds::FieldTypes

#for, #lookup, #register

Instance Method Details

#deserialize(value, session = nil) ⇒ Object



12
13
14
# File 'lib/facebook_ads/field_types/integer.rb', line 12

def deserialize(value, session = nil)
  value.is_a?(::Integer) ? value : value.to_s[/[0-9]+/].to_i
end

#serialize(value) ⇒ Object



16
17
18
# File 'lib/facebook_ads/field_types/integer.rb', line 16

def serialize(value)
  value.to_s
end