Class: FbGraph::Note
- Includes:
- Connections::Comments, Connections::Likes
- Defined in:
- lib/fb_graph/note.rb
Instance Attribute Summary collapse
-
#created_time ⇒ Object
Returns the value of attribute created_time.
-
#from ⇒ Object
Returns the value of attribute from.
-
#icon ⇒ Object
Returns the value of attribute icon.
-
#message ⇒ Object
Returns the value of attribute message.
-
#subject ⇒ Object
Returns the value of attribute subject.
-
#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 = {}) ⇒ Note
constructor
A new instance of Note.
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 = {}) ⇒ Note
Returns a new instance of Note.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/fb_graph/note.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 @subject = attributes[:subject] @message = attributes[:message] 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 @icon = attributes[:icon] # cached connection @_comments_ = Collection.new(attributes[:comments]) end |
Instance Attribute Details
#created_time ⇒ Object
Returns the value of attribute created_time.
6 7 8 |
# File 'lib/fb_graph/note.rb', line 6 def created_time @created_time end |
#from ⇒ Object
Returns the value of attribute from.
6 7 8 |
# File 'lib/fb_graph/note.rb', line 6 def from @from end |
#icon ⇒ Object
Returns the value of attribute icon.
6 7 8 |
# File 'lib/fb_graph/note.rb', line 6 def icon @icon end |
#message ⇒ Object
Returns the value of attribute message.
6 7 8 |
# File 'lib/fb_graph/note.rb', line 6 def @message end |
#subject ⇒ Object
Returns the value of attribute subject.
6 7 8 |
# File 'lib/fb_graph/note.rb', line 6 def subject @subject end |
#updated_time ⇒ Object
Returns the value of attribute updated_time.
6 7 8 |
# File 'lib/fb_graph/note.rb', line 6 def updated_time @updated_time end |