module SurveyMonkey

Constants

API_SETTINGS_PATH
SURVEY_MONKEY_DOTENV_PATH
VERSION

Public Class Methods

load_yaml_settings() click to toggle source
# File lib/survey_monkey.rb, line 19
def self.load_yaml_settings
  file = File.open API_SETTINGS_PATH
  settings = YAML.load file
  raise 'api_settings.yml NOT FOUND' if settings.nil? || settings.empty?
  settings
end
method_missing(meth, *args, &block) click to toggle source
Calls superclass method
# File lib/survey_monkey.rb, line 26
def self.method_missing(meth, *args, &block)
  settings = SurveyMonkey.load_yaml_settings
  settings.keys.each do |key|
    if ( key.to_s == meth.to_s )
      if args.empty? 
        return Request.new( Hash[api_method: meth] ) 
      else
        options = args.first
        options.merge!(Hash[api_method: meth])
        return Request.new(options)
      end
    end
  end
  super
end
request(options) click to toggle source
# File lib/survey_monkey.rb, line 15
def self.request(options)
  Request.new(options)
end