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



24
25
26
# File 'lib/facebook_ads/field_types/integer.rb', line 24

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

#serialize(value) ⇒ Object



28
29
30
# File 'lib/facebook_ads/field_types/integer.rb', line 28

def serialize(value)
  value.to_s
end