Class: FbGraph::Video
- Defined in:
- lib/fb_graph/video.rb
Instance Attribute Summary collapse
-
#created_time ⇒ Object
Returns the value of attribute created_time.
-
#description ⇒ Object
Returns the value of attribute description.
-
#embed_html ⇒ Object
Returns the value of attribute embed_html.
-
#from ⇒ Object
Returns the value of attribute from.
-
#icon ⇒ Object
Returns the value of attribute icon.
-
#name ⇒ Object
Returns the value of attribute name.
-
#source ⇒ Object
Returns the value of attribute source.
-
#tags ⇒ Object
Returns the value of attribute tags.
-
#updated_time ⇒ Object
Returns the value of attribute updated_time.
Attributes inherited from Node
#access_token, #endpoint, #identifier
Instance Method Summary collapse
-
#initialize(identifier, attributes = {}) ⇒ Video
constructor
A new instance of Video.
Methods included from Connections::Picture
Methods included from Connections::Likes
Methods included from Connections::Comments
#comment!, #comments, #like!, #unlike!
Methods inherited from Node
#connection, #destroy, fetch, #fetch, #update
Methods included from Comparison
Constructor Details
#initialize(identifier, attributes = {}) ⇒ Video
Returns a new instance of Video.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/fb_graph/video.rb', line 9 def initialize(identifier, attributes = {}) super if (from = attributes[:from]) @from = if from[:category] Page.new(from[:id], from) else User.new(from[:id], from) end end @tags = [] if attributes[:tags] Collection.new(attributes[:tags]).each do |tag| @tags << Tag.new(tag) end end @name = attributes[:name] @description = attributes[:description] @embed_html = attributes[:embed_html] @icon = attributes[:icon] @source = attributes[:source] if attributes[:created_time] @created_time = Time.parse(attributes[:created_time]).utc end if attributes[:updated_time] @updated_time = Time.parse(attributes[:updated_time]).utc end # cached connection @_comments_ = Collection.new(attributes[:comments]) end |
Instance Attribute Details
#created_time ⇒ Object
Returns the value of attribute created_time.
7 8 9 |
# File 'lib/fb_graph/video.rb', line 7 def created_time @created_time end |
#description ⇒ Object
Returns the value of attribute description.
7 8 9 |
# File 'lib/fb_graph/video.rb', line 7 def description @description end |
#embed_html ⇒ Object
Returns the value of attribute embed_html.
7 8 9 |
# File 'lib/fb_graph/video.rb', line 7 def @embed_html end |
#from ⇒ Object
Returns the value of attribute from.
7 8 9 |
# File 'lib/fb_graph/video.rb', line 7 def from @from end |
#icon ⇒ Object
Returns the value of attribute icon.
7 8 9 |
# File 'lib/fb_graph/video.rb', line 7 def icon @icon end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/fb_graph/video.rb', line 7 def name @name end |
#source ⇒ Object
Returns the value of attribute source.
7 8 9 |
# File 'lib/fb_graph/video.rb', line 7 def source @source end |
#tags ⇒ Object
Returns the value of attribute tags.
7 8 9 |
# File 'lib/fb_graph/video.rb', line 7 def @tags end |
#updated_time ⇒ Object
Returns the value of attribute updated_time.
7 8 9 |
# File 'lib/fb_graph/video.rb', line 7 def updated_time @updated_time end |