Sha256: 29cfd241d29302e63e14a87104770073752f3f37481335de86a77289e7d8f3a9

Contents?: true

Size: 306 Bytes

Versions: 4

Compression:

Stored size: 306 Bytes

Contents

module Pollster

  class Question < Base

    attr_reader :name, :chart, :topic, :state, :subpopulations

    def initialize(params={})
      params.each_pair do |k,v|
        instance_variable_set("@#{k}", v)
      end
    end

    def responses
      subpopulations.first[:responses]
    end

  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
pollster-0.2.3 lib/pollster/question.rb
pollster-0.2.2 lib/pollster/question.rb
pollster-0.2.1 lib/pollster/question.rb
pollster-0.2.0 lib/pollster/question.rb