Class: FbGraph::Photo
- Includes:
- Connections::Comments
- Defined in:
- lib/fb_graph/photo.rb
Instance Attribute Summary collapse
-
#created_time ⇒ Object
Returns the value of attribute created_time.
-
#from ⇒ Object
Returns the value of attribute from.
-
#height ⇒ Object
Returns the value of attribute height.
-
#link ⇒ Object
Returns the value of attribute link.
-
#name ⇒ Object
Returns the value of attribute name.
-
#picture ⇒ Object
Returns the value of attribute picture.
-
#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.
-
#width ⇒ Object
Returns the value of attribute width.
Attributes inherited from Node
#access_token, #endpoint, #identifier
Instance Method Summary collapse
-
#initialize(identifier, options = {}) ⇒ Photo
constructor
A new instance of Photo.
Methods included from Connections::Comments
Methods inherited from Node
Methods included from Comparison
Constructor Details
#initialize(identifier, options = {}) ⇒ Photo
Returns a new instance of Photo.
7 8 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 |
# File 'lib/fb_graph/photo.rb', line 7 def initialize(identifier, = {}) super if (from = [:from]) @from = if from[:category] FbGraph::Page.new(from.delete(:id), from) else FbGraph::User.new(from.delete(:id), from) end end @tags = [] if [:tags] FbGraph::Collection.new([:tags]).each do |tag| @tags << FbGraph::Tag.new(tag.delete(:id), tag) end end # NOTE: # for some reason, facebook uses different parameter names. # "name" in GET & "message" in POST @name = [:name] || [:message] @picture = [:picture] @source = [:source] @height = [:height] @width = [:width] @link = [:link] if [:created_time] @created_time = Time.parse([:created_time]).utc end if [:updated_time] @updated_time = Time.parse([:updated_time]).utc end end |
Instance Attribute Details
#created_time ⇒ Object
Returns the value of attribute created_time.
5 6 7 |
# File 'lib/fb_graph/photo.rb', line 5 def created_time @created_time end |
#from ⇒ Object
Returns the value of attribute from.
5 6 7 |
# File 'lib/fb_graph/photo.rb', line 5 def from @from end |
#height ⇒ Object
Returns the value of attribute height.
5 6 7 |
# File 'lib/fb_graph/photo.rb', line 5 def height @height end |
#link ⇒ Object
Returns the value of attribute link.
5 6 7 |
# File 'lib/fb_graph/photo.rb', line 5 def link @link end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/fb_graph/photo.rb', line 5 def name @name end |
#picture ⇒ Object
Returns the value of attribute picture.
5 6 7 |
# File 'lib/fb_graph/photo.rb', line 5 def picture @picture end |
#source ⇒ Object
Returns the value of attribute source.
5 6 7 |
# File 'lib/fb_graph/photo.rb', line 5 def source @source end |
#tags ⇒ Object
Returns the value of attribute tags.
5 6 7 |
# File 'lib/fb_graph/photo.rb', line 5 def @tags end |
#updated_time ⇒ Object
Returns the value of attribute updated_time.
5 6 7 |
# File 'lib/fb_graph/photo.rb', line 5 def updated_time @updated_time end |
#width ⇒ Object
Returns the value of attribute width.
5 6 7 |
# File 'lib/fb_graph/photo.rb', line 5 def width @width end |