Sha256: c28e2f07529253d29212f9c3c5ada343da40d08be585af500a13a8c94ca1db41

Contents?: true

Size: 611 Bytes

Versions: 11

Compression:

Stored size: 611 Bytes

Contents

class ApiConfiguration

  attr_accessor :protocol, :host, :namespace, :port, :verbosity, :priority, :substitution, :csv_mode

  # initializes a configuration object from given YAML file for given environment
  def initialize(raw_config, env)
    raw_config[env.to_s].each { |key, value| self.instance_variable_set("@#{key}", value) }
    self.verbosity = raw_config['general']['verbosity'].first
    self.priority = raw_config['general']['priority'] || 0
    self.substitution = raw_config['general']['substitution']
    self.csv_mode = raw_config['general']['csv_mode'].first rescue "none"
    self
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
apirunner-0.5.5 lib/api_configuration.rb
apirunner-0.5.0 lib/api_configuration.rb
apirunner-0.4.10 lib/api_configuration.rb
apirunner-0.4.9 lib/api_configuration.rb
apirunner-0.4.8 lib/api_configuration.rb
apirunner-0.4.7 lib/api_configuration.rb
apirunner-0.4.6 lib/api_configuration.rb
apirunner-0.4.5 lib/api_configuration.rb
apirunner-0.4.4 lib/api_configuration.rb
apirunner-0.4.3 lib/api_configuration.rb
apirunner-0.4.2 lib/api_configuration.rb