Class: GSGraph::Album
- Includes:
- Connections::Comments, Connections::Likes, Connections::Likes::Likable, Connections::Photos, Connections::Picture
- Defined in:
- lib/gs_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, #raw_attributes
Instance Method Summary collapse
-
#initialize(identifier, attributes = {}) ⇒ Album
constructor
A new instance of Album.
- #picture_with_access_token(options_or_size = {}) ⇒ Object
Methods included from Connections::Picture
Methods included from Connections::Likes::Likable
Methods included from Connections::Likes
Methods included from Connections::Comments
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.
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 43 |
# File 'lib/gs_graph/album.rb', line 11 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 cache_collection attributes, :comments end |
Instance Attribute Details
#count ⇒ Object
Returns the value of attribute count.
9 10 11 |
# File 'lib/gs_graph/album.rb', line 9 def count @count end |
#cover_photo ⇒ Object
Returns the value of attribute cover_photo.
9 10 11 |
# File 'lib/gs_graph/album.rb', line 9 def cover_photo @cover_photo end |
#created_time ⇒ Object
Returns the value of attribute created_time.
9 10 11 |
# File 'lib/gs_graph/album.rb', line 9 def created_time @created_time end |
#description ⇒ Object
Returns the value of attribute description.
9 10 11 |
# File 'lib/gs_graph/album.rb', line 9 def description @description end |
#from ⇒ Object
Returns the value of attribute from.
9 10 11 |
# File 'lib/gs_graph/album.rb', line 9 def from @from end |
#link ⇒ Object
Returns the value of attribute link.
9 10 11 |
# File 'lib/gs_graph/album.rb', line 9 def link @link end |
#location ⇒ Object
Returns the value of attribute location.
9 10 11 |
# File 'lib/gs_graph/album.rb', line 9 def location @location end |
#name ⇒ Object
Returns the value of attribute name.
9 10 11 |
# File 'lib/gs_graph/album.rb', line 9 def name @name end |
#privacy ⇒ Object
Returns the value of attribute privacy.
9 10 11 |
# File 'lib/gs_graph/album.rb', line 9 def privacy @privacy end |
#type ⇒ Object
Returns the value of attribute type.
9 10 11 |
# File 'lib/gs_graph/album.rb', line 9 def type @type end |
#updated_time ⇒ Object
Returns the value of attribute updated_time.
9 10 11 |
# File 'lib/gs_graph/album.rb', line 9 def updated_time @updated_time end |
Instance Method Details
#picture_with_access_token(options_or_size = {}) ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/gs_graph/album.rb', line 45 def picture_with_access_token( = {}) response = picture_without_access_token if response.is_a?(GSGraph::Picture) response else _endpoint_ = URI.parse response if self.access_token _endpoint_.query = [_endpoint_.query, {:access_token => self.access_token.to_s}.to_query].compact.join('&') end _endpoint_.to_s end end |