Module: ShadoPuppet::Configuration

Included in:
ShadoPuppet
Defined in:
lib/shado_puppet/configuration.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.method_missing(symbol, *args) ⇒ Object



16
17
18
19
20
21
22
23
24
# File 'lib/shado_puppet/configuration.rb', line 16

def method_missing(symbol, *args)
  if args.empty?
    options.key?(symbol) ? options[symbol] : super
  else
    value = args.first
    value.symbolize_keys! if value.is_a?(Hash)
    options[symbol] = value
  end
end

.optionsObject



8
9
10
11
12
13
14
# File 'lib/shado_puppet/configuration.rb', line 8

def options
  @options ||= {
    :ssl => true,
    :domain => "api.moonshado.com",
    :message => {}
  }
end

.siteObject



26
27
28
# File 'lib/shado_puppet/configuration.rb', line 26

def site
  (ssl ? "https://" : "http://") + domain + "/"
end

Instance Method Details

#configure(&block) ⇒ Object



3
4
5
# File 'lib/shado_puppet/configuration.rb', line 3

def configure(&block)
  block.bind(Configuration).call
end