Module: Zenps

Defined in:
lib/zenps-ruby.rb,
lib/zenps/client.rb,
lib/zenps/survey.rb,
lib/zenps/payload.rb

Overview

Zenps ruby wrapper

Defined Under Namespace

Classes: Client, ConfigurationPathError, KeyMissingError, Payload, Survey

Class Method Summary collapse

Class Method Details

.configObject



32
33
34
# File 'lib/zenps-ruby.rb', line 32

def self.config
  @config
end

.configure(options = {}) ⇒ Object

Configure through hash



18
19
20
# File 'lib/zenps-ruby.rb', line 18

def self.configure(options = {})
  options.each { |k, v| @config[k.to_sym] = v if @valid_config_keys.include? k.to_sym }
end

.configure_with(path_to_yaml_file) ⇒ Object

Configure through yaml file



23
24
25
26
27
28
29
30
# File 'lib/zenps-ruby.rb', line 23

def self.configure_with(path_to_yaml_file)
  begin
    config = YAML.safe_load(IO.read(path_to_yaml_file))
  rescue Errno::ENOENT
    raise ConfigurationPathError
  end
  configure(config)
end