Class: FbGraph::AdConnectionObject
- Defined in:
- lib/fb_graph/ad_connection_object.rb
Constant Summary collapse
- TYPES =
{ :page => 1, :application => 2, :event => 3, :place => 6, :domain => 7 }
- SUPPORTED_PLATFORM_TYPES =
{ :web => 1, :canvas => 2, :mobile_web => 3, :iphone => 4, :ipad => 5, :android => 6 }
Instance Attribute Summary collapse
-
#is_game ⇒ Object
Returns the value of attribute is_game.
-
#name ⇒ Object
Returns the value of attribute name.
-
#object ⇒ Object
Returns the value of attribute object.
-
#og_actions ⇒ Object
Returns the value of attribute og_actions.
-
#og_namespace ⇒ Object
Returns the value of attribute og_namespace.
-
#og_objects ⇒ Object
Returns the value of attribute og_objects.
-
#picture ⇒ Object
Returns the value of attribute picture.
-
#supported_platforms ⇒ Object
Returns the value of attribute supported_platforms.
-
#tabs ⇒ Object
Returns the value of attribute tabs.
-
#type ⇒ Object
Returns the value of attribute type.
-
#url ⇒ Object
Returns the value of attribute url.
Attributes inherited from Node
#access_token, #endpoint, #identifier, #raw_attributes
Instance Method Summary collapse
-
#initialize(identifier, attributes = {}) ⇒ AdConnectionObject
constructor
A new instance of AdConnectionObject.
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.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/fb_graph/ad_connection_object.rb', line 22 def initialize(identifier, attributes = {}) super %w(name url type tabs picture).each do |field| send("#{field}=", attributes[field.to_sym]) end if self.type == TYPES[:application] %w(is_game og_actions og_namespace og_objects supported_platforms).each do |field| send("#{field}=", attributes[field.to_sym]) end 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
#is_game ⇒ Object
Returns the value of attribute is_game.
3 4 5 |
# File 'lib/fb_graph/ad_connection_object.rb', line 3 def is_game @is_game end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/fb_graph/ad_connection_object.rb', line 3 def name @name end |
#object ⇒ Object
Returns the value of attribute object.
3 4 5 |
# File 'lib/fb_graph/ad_connection_object.rb', line 3 def object @object end |
#og_actions ⇒ Object
Returns the value of attribute og_actions.
3 4 5 |
# File 'lib/fb_graph/ad_connection_object.rb', line 3 def og_actions @og_actions end |
#og_namespace ⇒ Object
Returns the value of attribute og_namespace.
3 4 5 |
# File 'lib/fb_graph/ad_connection_object.rb', line 3 def og_namespace @og_namespace end |
#og_objects ⇒ Object
Returns the value of attribute og_objects.
3 4 5 |
# File 'lib/fb_graph/ad_connection_object.rb', line 3 def og_objects @og_objects end |
#picture ⇒ Object
Returns the value of attribute picture.
3 4 5 |
# File 'lib/fb_graph/ad_connection_object.rb', line 3 def picture @picture end |
#supported_platforms ⇒ Object
Returns the value of attribute supported_platforms.
3 4 5 |
# File 'lib/fb_graph/ad_connection_object.rb', line 3 def supported_platforms @supported_platforms end |
#tabs ⇒ Object
Returns the value of attribute tabs.
3 4 5 |
# File 'lib/fb_graph/ad_connection_object.rb', line 3 def tabs @tabs end |
#type ⇒ Object
Returns the value of attribute type.
3 4 5 |
# File 'lib/fb_graph/ad_connection_object.rb', line 3 def type @type end |
#url ⇒ Object
Returns the value of attribute url.
3 4 5 |
# File 'lib/fb_graph/ad_connection_object.rb', line 3 def url @url end |