Class: FbGraph::Album
- Defined in:
- lib/fb_graph/album.rb
Instance Attribute Summary collapse
-
#count ⇒ Object
Returns the value of attribute count.
-
#cover_photo ⇒ Object
Returns the value of attribute cover_photo.
-
#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.
-
#type ⇒ Object
Returns the value of attribute type.
-
#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.
- #picture_with_access_token(size = nil) ⇒ Object
Methods included from Connections::Picture
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, #update
Methods included from Comparison
Constructor Details
#initialize(identifier, attributes = {}) ⇒ Album
Returns a new instance of Album.
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 39 40 41 42 |
# File 'lib/fb_graph/album.rb', line 10 def initialize(identifier, attributes = {}) super @from = if (from = attributes[:from]) if from[:category] Page.new(from[:id], from) else User.new(from[:id], from) end end @name = attributes[:name] # NOTE: # for some reason, facebook uses different parameter names. # "description" in GET & "message" in POST @description = attributes[:description] || attributes[:message] @location = attributes[:location] @link = attributes[:link] @privacy = attributes[:privacy] @count = attributes[:count] @type = attributes[:type] @cover_photo = if attributes[:cover_photo] Photo.new(attributes[:cover_photo]) end @created_time = if attributes[:created_time] Time.parse(attributes[:created_time]).utc end @updated_time = if attributes[:updated_time] Time.parse(attributes[:updated_time]).utc end # cached connection @_comments_ = Collection.new(attributes[:comments]) end |
Instance Attribute Details
#count ⇒ Object
Returns the value of attribute count.
8 9 10 |
# File 'lib/fb_graph/album.rb', line 8 def count @count end |
#cover_photo ⇒ Object
Returns the value of attribute cover_photo.
8 9 10 |
# File 'lib/fb_graph/album.rb', line 8 def cover_photo @cover_photo end |
#created_time ⇒ Object
Returns the value of attribute created_time.
8 9 10 |
# File 'lib/fb_graph/album.rb', line 8 def created_time @created_time end |
#description ⇒ Object
Returns the value of attribute description.
8 9 10 |
# File 'lib/fb_graph/album.rb', line 8 def description @description end |
#from ⇒ Object
Returns the value of attribute from.
8 9 10 |
# File 'lib/fb_graph/album.rb', line 8 def from @from end |
#link ⇒ Object
Returns the value of attribute link.
8 9 10 |
# File 'lib/fb_graph/album.rb', line 8 def link @link end |
#location ⇒ Object
Returns the value of attribute location.
8 9 10 |
# File 'lib/fb_graph/album.rb', line 8 def location @location end |
#name ⇒ Object
Returns the value of attribute name.
8 9 10 |
# File 'lib/fb_graph/album.rb', line 8 def name @name end |
#privacy ⇒ Object
Returns the value of attribute privacy.
8 9 10 |
# File 'lib/fb_graph/album.rb', line 8 def privacy @privacy end |
#type ⇒ Object
Returns the value of attribute type.
8 9 10 |
# File 'lib/fb_graph/album.rb', line 8 def type @type end |
#updated_time ⇒ Object
Returns the value of attribute updated_time.
8 9 10 |
# File 'lib/fb_graph/album.rb', line 8 def updated_time @updated_time end |
Instance Method Details
#picture_with_access_token(size = nil) ⇒ Object
44 45 46 47 48 49 |
# File 'lib/fb_graph/album.rb', line 44 def picture_with_access_token(size = nil) raise Unauthorized.new('Album picture connection requires an access token') unless self.access_token _endpoint_ = URI.parse picture_without_access_token(size) _endpoint_.query = [_endpoint_.query, {:access_token => self.access_token.to_s}.to_query].compact.join('&') _endpoint_.to_s end |