Class: FbGraph::QuestionOption
- Includes:
- Connections::Votes
- Defined in:
- lib/fb_graph/question_option.rb
Instance Attribute Summary collapse
-
#created_time ⇒ Object
Returns the value of attribute created_time.
-
#from ⇒ Object
Returns the value of attribute from.
-
#name ⇒ Object
Returns the value of attribute name.
-
#object ⇒ Object
Returns the value of attribute object.
-
#vote_count ⇒ Object
Returns the value of attribute vote_count.
Attributes inherited from Node
#access_token, #endpoint, #identifier, #raw_attributes
Instance Method Summary collapse
-
#initialize(identifier, attributes = {}) ⇒ QuestionOption
constructor
A new instance of QuestionOption.
Methods included from Connections::Votes
Methods inherited from Node
#connection, #destroy, fetch, #fetch, #update
Methods included from Comparison
Constructor Details
#initialize(identifier, attributes = {}) ⇒ QuestionOption
Returns a new instance of QuestionOption.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/fb_graph/question_option.rb', line 7 def initialize(identifier, attributes = {}) super @from = if attributes[:from] User.new(attributes[:from][:id], attributes[:from]) end @name = attributes[:name] @vote_count = attributes[:votes] @object = if attributes[:object] Page.new(attributes[:object][:id], attributes[:object]) end @created_time = if attributes[:created_time] Time.parse(attributes[:created_time]).utc end end |
Instance Attribute Details
#created_time ⇒ Object
Returns the value of attribute created_time.
5 6 7 |
# File 'lib/fb_graph/question_option.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_option.rb', line 5 def from @from end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/fb_graph/question_option.rb', line 5 def name @name end |
#object ⇒ Object
Returns the value of attribute object.
5 6 7 |
# File 'lib/fb_graph/question_option.rb', line 5 def object @object end |
#vote_count ⇒ Object
Returns the value of attribute vote_count.
5 6 7 |
# File 'lib/fb_graph/question_option.rb', line 5 def vote_count @vote_count end |