Class: FbGraph::Link
- Inherits:
-
Node
- Object
- Node
- FbGraph::Link
- Includes:
- Connections::Comments, Connections::Likes, Connections::Likes::Likable
- Defined in:
- lib/fb_graph/link.rb
Instance Attribute Summary (collapse)
-
- (Object) created_time
Returns the value of attribute created_time.
-
- (Object) description
Returns the value of attribute description.
-
- (Object) from
Returns the value of attribute from.
-
- (Object) icon
Returns the value of attribute icon.
-
- (Object) link
Returns the value of attribute link.
-
- (Object) message
Returns the value of attribute message.
-
- (Object) name
Returns the value of attribute name.
-
- (Object) picture
Returns the value of attribute picture.
Attributes inherited from Node
#access_token, #endpoint, #identifier, #raw_attributes
Instance Method Summary (collapse)
-
- (Link) initialize(identifier, attributes = {})
constructor
A new instance of Link.
Methods included from Connections::Likes::Likable
Methods included from Connections::Likes
Methods included from Connections::Comments
Methods inherited from Node
#connection, #destroy, fetch, #fetch, #update
Methods included from Comparison
Constructor Details
- (Link) initialize(identifier, attributes = {})
A new instance of Link
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/fb_graph/link.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 @name = attributes[:name] @link = attributes[:link] @description = attributes[:description] @icon = attributes[:icon] @picture = attributes[:picture] # NOTE: this is external image, so isn't connection. @message = attributes[:message] if attributes[:created_time] @created_time = Time.parse(attributes[:created_time]).utc end # cached connection cache_collection attributes, :comments end |
Instance Attribute Details
- (Object) created_time
Returns the value of attribute created_time
7 8 9 |
# File 'lib/fb_graph/link.rb', line 7 def created_time @created_time end |
- (Object) description
Returns the value of attribute description
7 8 9 |
# File 'lib/fb_graph/link.rb', line 7 def description @description end |
- (Object) from
Returns the value of attribute from
7 8 9 |
# File 'lib/fb_graph/link.rb', line 7 def from @from end |
- (Object) icon
Returns the value of attribute icon
7 8 9 |
# File 'lib/fb_graph/link.rb', line 7 def icon @icon end |
- (Object) link
Returns the value of attribute link
7 8 9 |
# File 'lib/fb_graph/link.rb', line 7 def link @link end |
- (Object) message
Returns the value of attribute message
7 8 9 |
# File 'lib/fb_graph/link.rb', line 7 def @message end |
- (Object) name
Returns the value of attribute name
7 8 9 |
# File 'lib/fb_graph/link.rb', line 7 def name @name end |
- (Object) picture
Returns the value of attribute picture
7 8 9 |
# File 'lib/fb_graph/link.rb', line 7 def picture @picture end |