class Adparlor::Facebook::GraphApi::AdTargetingSearch

Public Class Methods

new(access_token) click to toggle source
# File lib/adparlor/facebook/graph_api/ad_targeting_search.rb, line 7
def initialize(access_token)
  @access_token = access_token
end

Public Instance Methods

path() click to toggle source
# File lib/adparlor/facebook/graph_api/ad_targeting_search.rb, line 11
def path
  '/search'
end

Private Instance Methods

parse_value(key, value) click to toggle source
# File lib/adparlor/facebook/graph_api/ad_targeting_search.rb, line 45
def parse_value(key, value)
  case key
  when 'countries'
    obj = AdTargetingTypes::AdGeolocations::AdCountry.new
  when 'cities'
    obj = AdTargetingTypes::AdGeolocations::AdCity.new
  when 'regions'
    obj = AdTargetingTypes::AdGeolocations::AdRegion.new
  when 'zips'
    obj = AdTargetingTypes::AdGeolocations::AdZipCode.new
  else
    return value.to_s
  end
  value.each { |k, v| obj.send("#{k}=".to_sym, v) }
  obj
end