Class: FbGraph::AdConnectionObject

Inherits:
Node
  • Object
show all
Defined in:
lib/fb_graph/ad_connection_object.rb

Constant Summary collapse

TYPES =
{
  :page => 1,
  :application => 2,
  :event => 3,
  :place => 6,
  :domain => 7
}

Instance Attribute Summary collapse

Attributes inherited from Node

#access_token, #endpoint, #identifier

Instance Method Summary collapse

Methods inherited from Node

#connection, #destroy, fetch, #fetch, #update

Methods included from Comparison

#==

Constructor Details

#initialize(identifier, attributes = {}) ⇒ AdConnectionObject

Returns a new instance of AdConnectionObject.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/fb_graph/ad_connection_object.rb', line 13

def initialize(identifier, attributes = {})
  super

  %w(name url type tabs picture).each do |field|
    send("#{field}=", attributes[field.to_sym])
  end

  self.object = if page?
    FbGraph::Page.new(identifier)
  elsif application?
    FbGraph::Application.new(identifier)
  elsif event?
    FbGraph::Event.new(identifier)
  elsif place?
    FbGraph::Place.new(identifier)
  elsif domain?
    FbGraph::Domain.new(identifier)
  end
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/fb_graph/ad_connection_object.rb', line 3

def name
  @name
end

#objectObject

Returns the value of attribute object.



3
4
5
# File 'lib/fb_graph/ad_connection_object.rb', line 3

def object
  @object
end

#pictureObject

Returns the value of attribute picture.



3
4
5
# File 'lib/fb_graph/ad_connection_object.rb', line 3

def picture
  @picture
end

#tabsObject

Returns the value of attribute tabs.



3
4
5
# File 'lib/fb_graph/ad_connection_object.rb', line 3

def tabs
  @tabs
end

#typeObject

Returns the value of attribute type.



3
4
5
# File 'lib/fb_graph/ad_connection_object.rb', line 3

def type
  @type
end

#urlObject

Returns the value of attribute url.



3
4
5
# File 'lib/fb_graph/ad_connection_object.rb', line 3

def url
  @url
end