Class: FbGraph::Link
- Includes:
- Connections::Comments, Connections::Likes
- Defined in:
- lib/fb_graph/link.rb
Instance Attribute Summary collapse
-
#caption ⇒ Object
Returns the value of attribute caption.
-
#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.
-
#icon ⇒ Object
Returns the value of attribute icon.
-
#link ⇒ Object
Returns the value of attribute link.
-
#message ⇒ Object
Returns the value of attribute message.
-
#name ⇒ Object
Returns the value of attribute name.
-
#picture ⇒ Object
Returns the value of attribute picture.
Attributes inherited from Node
#access_token, #endpoint, #identifier
Instance Method Summary collapse
-
#initialize(identifier, attributes = {}) ⇒ Link
constructor
A new instance of Link.
Methods included from Connections::Likes
Methods included from Connections::Comments
#comment!, #comments, #like!, #unlike!
Methods inherited from Node
#connection, #destroy, fetch, #fetch
Methods included from Comparison
Constructor Details
#initialize(identifier, attributes = {}) ⇒ Link
Returns a new instance of Link.
8 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 8 def initialize(identifier, attributes = {}) super if (from = attributes[:from]) @from = if from[:category] Page.new(from.delete(:id), from) else User.new(from.delete(:id), from) end end @name = attributes[:name] @link = attributes[:link] @caption = attributes[:caption] @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 @_comments_ = Collection.new(attributes[:comments]) end |
Instance Attribute Details
#caption ⇒ Object
Returns the value of attribute caption.
6 7 8 |
# File 'lib/fb_graph/link.rb', line 6 def @caption end |
#created_time ⇒ Object
Returns the value of attribute created_time.
6 7 8 |
# File 'lib/fb_graph/link.rb', line 6 def created_time @created_time end |
#description ⇒ Object
Returns the value of attribute description.
6 7 8 |
# File 'lib/fb_graph/link.rb', line 6 def description @description end |
#from ⇒ Object
Returns the value of attribute from.
6 7 8 |
# File 'lib/fb_graph/link.rb', line 6 def from @from end |
#icon ⇒ Object
Returns the value of attribute icon.
6 7 8 |
# File 'lib/fb_graph/link.rb', line 6 def icon @icon end |
#link ⇒ Object
Returns the value of attribute link.
6 7 8 |
# File 'lib/fb_graph/link.rb', line 6 def link @link end |
#message ⇒ Object
Returns the value of attribute message.
6 7 8 |
# File 'lib/fb_graph/link.rb', line 6 def @message end |
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'lib/fb_graph/link.rb', line 6 def name @name end |
#picture ⇒ Object
Returns the value of attribute picture.
6 7 8 |
# File 'lib/fb_graph/link.rb', line 6 def picture @picture end |