Class: FbGraph::Album
- Defined in:
- lib/fb_graph/album.rb
Instance Attribute Summary collapse
-
#count ⇒ Object
Returns the value of attribute count.
-
#created_time ⇒ Object
Returns the value of attribute created_time.
-
#description ⇒ Object
Returns the value of attribute description.
-
#from ⇒ Object
Returns the value of attribute from.
-
#link ⇒ Object
Returns the value of attribute link.
-
#location ⇒ Object
Returns the value of attribute location.
-
#name ⇒ Object
Returns the value of attribute name.
-
#privacy ⇒ Object
Returns the value of attribute privacy.
-
#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 = {}) ⇒ Album
constructor
A new instance of Album.
Methods included from Connections::Likes
Methods included from Connections::Comments
#comment!, #comments, #like!, #unlike!
Methods included from Connections::Photos
Methods inherited from Node
#connection, #destroy, fetch, #fetch
Methods included from Comparison
Constructor Details
#initialize(identifier, attributes = {}) ⇒ Album
Returns a new instance of Album.
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/album.rb', line 9 def initialize(identifier, attributes = {}) super if (from = attributes[:from]) @from = if from[:category] FbGraph::Page.new(from.delete(:id), from) else FbGraph::User.new(from.delete(:id), from) end end @name = attributes[:name] # NOTE: # for some reason, facebook uses different parameter names. # "description" in GET & "message" in POST # TODO: # check whether this issue is solved or not @description = attributes[:description] || attributes[:message] @location = attributes[:location] @link = attributes[:link] @privacy = attributes[:privacy] @count = attributes[:count] 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_ = FbGraph::Collection.new(attributes[:comments]) end |
Instance Attribute Details
#count ⇒ Object
Returns the value of attribute count.
7 8 9 |
# File 'lib/fb_graph/album.rb', line 7 def count @count end |
#created_time ⇒ Object
Returns the value of attribute created_time.
7 8 9 |
# File 'lib/fb_graph/album.rb', line 7 def created_time @created_time end |
#description ⇒ Object
Returns the value of attribute description.
7 8 9 |
# File 'lib/fb_graph/album.rb', line 7 def description @description end |
#from ⇒ Object
Returns the value of attribute from.
7 8 9 |
# File 'lib/fb_graph/album.rb', line 7 def from @from end |
#link ⇒ Object
Returns the value of attribute link.
7 8 9 |
# File 'lib/fb_graph/album.rb', line 7 def link @link end |
#location ⇒ Object
Returns the value of attribute location.
7 8 9 |
# File 'lib/fb_graph/album.rb', line 7 def location @location end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/fb_graph/album.rb', line 7 def name @name end |
#privacy ⇒ Object
Returns the value of attribute privacy.
7 8 9 |
# File 'lib/fb_graph/album.rb', line 7 def privacy @privacy end |
#updated_time ⇒ Object
Returns the value of attribute updated_time.
7 8 9 |
# File 'lib/fb_graph/album.rb', line 7 def updated_time @updated_time end |