Module: Subordinate::Configuration

Included in:
Subordinate
Defined in:
lib/subordinate/configuration.rb

Constant Summary collapse

VALID_OPTIONS_KEYS =
[
  :username,
  :api_token,
  :api_endpoint,
  :domain,
  :subdomain,
  :port,
  :ssl
]

Instance Method Summary collapse

Instance Method Details

#configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:


16
17
18
# File 'lib/subordinate/configuration.rb', line 16

def configure
  yield self
end

#optionsObject


20
21
22
# File 'lib/subordinate/configuration.rb', line 20

def options
  VALID_OPTIONS_KEYS.inject({}){|o,k| o.merge!(k => send(k)) }
end

#reset!Object


24
25
26
27
28
# File 'lib/subordinate/configuration.rb', line 24

def reset!
  VALID_OPTIONS_KEYS.each {|key| instance_variable_set("@#{key}".to_sym, nil) }
  self.ssl = true
  self
end