Class: StashAPI::Options

Inherits:
Object
  • Object
show all
Defined in:
lib/stash_api/options.rb

Constant Summary collapse

@@default_options =
{}

Class Method Summary collapse

Class Method Details

.option(key, value = nil) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/stash_api/options.rb', line 9

def self.option(key, value = nil)
  return @@default_options[key] unless value
  @@default_options[key] = value

  if key == :domain
    build_base_uri
  end

  value
end

.optionsObject



5
6
7
# File 'lib/stash_api/options.rb', line 5

def self.options 
  @@default_options
end

.reset_defaultsObject



20
21
22
23
# File 'lib/stash_api/options.rb', line 20

def self.reset_defaults
  @@default_options = {}
  build_base_uri # reset the base_uri
end