Module: Isurvey::Base

Included in:
Answer, Question, Result
Defined in:
lib/isurvey/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/isurvey/base.rb', line 9

def method_missing(method, *args, &block)
  if hash.has_key? method
    @hash[method]
  else
    super
  end
end

Instance Attribute Details

#hashObject (readonly)

Returns the value of attribute hash.



3
4
5
# File 'lib/isurvey/base.rb', line 3

def hash
  @hash
end

Instance Method Details

#initialize(options) ⇒ Object



5
6
7
# File 'lib/isurvey/base.rb', line 5

def initialize(options)
  @hash = options[:hash]
end