Class: FbGraph::Question
- Inherits:
-
Node
- Object
- Node
- FbGraph::Question
- Includes:
- Connections::QuestionOptions
- Defined in:
- lib/fb_graph/question.rb
Instance Attribute Summary (collapse)
-
- (Object) created_time
Returns the value of attribute created_time.
-
- (Object) from
Returns the value of attribute from.
-
- (Object) question
Returns the value of attribute question.
-
- (Object) updated_time
Returns the value of attribute updated_time.
Attributes inherited from Node
#access_token, #endpoint, #identifier, #raw_attributes
Instance Method Summary (collapse)
-
- (Question) initialize(identifier, attributes = {})
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
- (Question) initialize(identifier, attributes = {})
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
- (Object) created_time
Returns the value of attribute created_time
5 6 7 |
# File 'lib/fb_graph/question.rb', line 5 def created_time @created_time end |
- (Object) from
Returns the value of attribute from
5 6 7 |
# File 'lib/fb_graph/question.rb', line 5 def from @from end |
- (Object) question
Returns the value of attribute question
5 6 7 |
# File 'lib/fb_graph/question.rb', line 5 def question @question end |
- (Object) updated_time
Returns the value of attribute updated_time
5 6 7 |
# File 'lib/fb_graph/question.rb', line 5 def updated_time @updated_time end |