Class: Pollster::Question
Constant Summary
Constants inherited from Base
Base::API_BASE, Base::API_SERVER
Instance Attribute Summary collapse
-
#chart ⇒ Object
readonly
Returns the value of attribute chart.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
-
#subpopulations ⇒ Object
readonly
Returns the value of attribute subpopulations.
-
#topic ⇒ Object
readonly
Returns the value of attribute topic.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Question
constructor
A new instance of Question.
- #responses ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ Question
Returns a new instance of Question.
7 8 9 10 11 |
# File 'lib/pollster/question.rb', line 7 def initialize(params={}) params.each_pair do |k,v| instance_variable_set("@#{k}", v) end end |
Instance Attribute Details
#chart ⇒ Object (readonly)
Returns the value of attribute chart.
5 6 7 |
# File 'lib/pollster/question.rb', line 5 def chart @chart end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/pollster/question.rb', line 5 def name @name end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
5 6 7 |
# File 'lib/pollster/question.rb', line 5 def state @state end |
#subpopulations ⇒ Object (readonly)
Returns the value of attribute subpopulations.
5 6 7 |
# File 'lib/pollster/question.rb', line 5 def subpopulations @subpopulations end |
#topic ⇒ Object (readonly)
Returns the value of attribute topic.
5 6 7 |
# File 'lib/pollster/question.rb', line 5 def topic @topic end |
Instance Method Details
#responses ⇒ Object
13 14 15 |
# File 'lib/pollster/question.rb', line 13 def responses subpopulations.first[:responses] end |