Class: FbGraph::Question
- Includes:
- Connections::QuestionOptions
- Defined in:
- lib/fb_graph/question.rb
Instance Attribute Summary collapse
-
#created_time ⇒ Object
Returns the value of attribute created_time.
-
#from ⇒ Object
Returns the value of attribute from.
-
#question ⇒ Object
Returns the value of attribute question.
-
#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 = {}) ⇒ Question
constructor
A new instance of Question.
Methods included from Connections::QuestionOptions
Methods inherited from Node
#connection, #destroy, fetch, #fetch, #update
Methods included from Comparison
Constructor Details
#initialize(identifier, attributes = {}) ⇒ Question
Returns a new instance of Question.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/fb_graph/question.rb', line 7 def initialize(identifier, attributes = {}) super @from = if attributes[:from] User.new(attributes[:from][:id], attributes[:from]) end @question = attributes[:question] @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 if attributes[:options] cache_collection attributes, :options end end |
Instance Attribute Details
#created_time ⇒ Object
Returns the value of attribute created_time.
5 6 7 |
# File 'lib/fb_graph/question.rb', line 5 def created_time @created_time end |
#from ⇒ Object
Returns the value of attribute from.
5 6 7 |
# File 'lib/fb_graph/question.rb', line 5 def from @from end |
#question ⇒ Object
Returns the value of attribute question.
5 6 7 |
# File 'lib/fb_graph/question.rb', line 5 def question @question end |
#updated_time ⇒ Object
Returns the value of attribute updated_time.
5 6 7 |
# File 'lib/fb_graph/question.rb', line 5 def updated_time @updated_time end |