Class: FbGraph::OpenGraph::Object
- Defined in:
- lib/fb_graph/open_graph/object.rb
Instance Attribute Summary collapse
-
#application ⇒ Object
Returns the value of attribute application.
-
#description ⇒ Object
Returns the value of attribute description.
-
#image ⇒ Object
Returns the value of attribute image.
-
#images ⇒ Object
Returns the value of attribute images.
-
#raw_attributes ⇒ Object
Returns the value of attribute raw_attributes.
-
#site_name ⇒ Object
Returns the value of attribute site_name.
-
#title ⇒ Object
Returns the value of attribute title.
-
#type ⇒ Object
Returns the value of attribute type.
-
#updated_time ⇒ Object
Returns the value of attribute updated_time.
-
#url ⇒ Object
Returns the value of attribute url.
Attributes inherited from Node
#access_token, #endpoint, #identifier
Instance Method Summary collapse
-
#initialize(identifier, attributes = {}) ⇒ Object
constructor
A new instance of Object.
Methods inherited from Node
#connection, #destroy, fetch, #fetch, #update
Methods included from Comparison
Constructor Details
#initialize(identifier, attributes = {}) ⇒ Object
Returns a new instance of Object.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/fb_graph/open_graph/object.rb', line 7 def initialize(identifier, attributes = {}) super @raw_attributes = attributes [:type, :url, :title, :description, :site_name].each do |key| self.send "#{key}=", attributes[key] end if application = attributes[:application] @application = Application.new(application[:id], application) end @images = [] if attributes[:image] attributes[:image].each do |image| @images << image[:url] end end @image = @images.first if attributes[:updated_time] @updated_time = Time.parse attributes[:updated_time] end end |
Instance Attribute Details
#application ⇒ Object
Returns the value of attribute application.
4 5 6 |
# File 'lib/fb_graph/open_graph/object.rb', line 4 def application @application end |
#description ⇒ Object
Returns the value of attribute description.
4 5 6 |
# File 'lib/fb_graph/open_graph/object.rb', line 4 def description @description end |
#image ⇒ Object
Returns the value of attribute image.
4 5 6 |
# File 'lib/fb_graph/open_graph/object.rb', line 4 def image @image end |
#images ⇒ Object
Returns the value of attribute images.
4 5 6 |
# File 'lib/fb_graph/open_graph/object.rb', line 4 def images @images end |
#raw_attributes ⇒ Object
Returns the value of attribute raw_attributes.
5 6 7 |
# File 'lib/fb_graph/open_graph/object.rb', line 5 def raw_attributes @raw_attributes end |
#site_name ⇒ Object
Returns the value of attribute site_name.
4 5 6 |
# File 'lib/fb_graph/open_graph/object.rb', line 4 def site_name @site_name end |
#title ⇒ Object
Returns the value of attribute title.
4 5 6 |
# File 'lib/fb_graph/open_graph/object.rb', line 4 def title @title end |
#type ⇒ Object
Returns the value of attribute type.
4 5 6 |
# File 'lib/fb_graph/open_graph/object.rb', line 4 def type @type end |
#updated_time ⇒ Object
Returns the value of attribute updated_time.
4 5 6 |
# File 'lib/fb_graph/open_graph/object.rb', line 4 def updated_time @updated_time end |
#url ⇒ Object
Returns the value of attribute url.
4 5 6 |
# File 'lib/fb_graph/open_graph/object.rb', line 4 def url @url end |