Class: FbGraph::Targeting

Inherits:
Object
  • Object
show all
Includes:
Comparison
Defined in:
lib/fb_graph/targeting.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Comparison

#==

Constructor Details

#initialize(attributes = {}) ⇒ Targeting

Returns a new instance of Targeting



7
8
9
10
11
12
# File 'lib/fb_graph/targeting.rb', line 7

def initialize(attributes = {})
  @country = attributes[:country]
  @city    = attributes[:city]
  @region  = attributes[:region]
  @locale  = attributes[:locale]
end

Instance Attribute Details

#cityObject

Returns the value of attribute city



5
6
7
# File 'lib/fb_graph/targeting.rb', line 5

def city
  @city
end

#countryObject

Returns the value of attribute country



5
6
7
# File 'lib/fb_graph/targeting.rb', line 5

def country
  @country
end

#localeObject

Returns the value of attribute locale



5
6
7
# File 'lib/fb_graph/targeting.rb', line 5

def locale
  @locale
end

#regionObject

Returns the value of attribute region



5
6
7
# File 'lib/fb_graph/targeting.rb', line 5

def region
  @region
end

Instance Method Details

#to_hash(options = {}) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/fb_graph/targeting.rb', line 14

def to_hash(options = {})
  {
    :country => self.country,
    :city    => self.city,
    :region  => self.region,
    :locale  => self.locale
  }
end