Class: YSM::Config
- Inherits:
-
Object
- Object
- YSM::Config
- Defined in:
- lib/ysm4r/client.rb
Constant Summary collapse
- HeaderKeys =
[:username, :password, :license, :masterAccountID, :accountID]
Instance Attribute Summary collapse
-
#sandbox ⇒ Object
readonly
Returns the value of attribute sandbox.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Config
constructor
A new instance of Config.
- #makeHeaders ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Config
Returns a new instance of Config.
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/ysm4r/client.rb', line 13 def initialize(={}) @sandbox = false IO.foreach(filename) do |line| next if line =~ /^#/ name, value = line.split('=') value = ([name] || value.strip) instance_variable_set(atsym(name), value) end @sandbox = ['True', 'true', '1'].include?(@sandbox.strip) end |
Instance Attribute Details
#sandbox ⇒ Object (readonly)
Returns the value of attribute sandbox.
11 12 13 |
# File 'lib/ysm4r/client.rb', line 11 def sandbox @sandbox end |
Instance Method Details
#makeHeaders ⇒ Object
24 25 26 27 28 29 |
# File 'lib/ysm4r/client.rb', line 24 def makeHeaders HeaderKeys.map do |key| Service::HeaderHandler.new( key.to_s, instance_variable_get(atsym(key))) end end |