Class: Biro::Configuration

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/biro/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#environmentObject

Returns the value of attribute environment.



7
8
9
# File 'lib/biro/configuration.rb', line 7

def environment
  @environment
end

#loggerObject

Returns the value of attribute logger.



7
8
9
# File 'lib/biro/configuration.rb', line 7

def logger
  @logger
end

Instance Method Details

#development!Object



13
14
15
# File 'lib/biro/configuration.rb', line 13

def development!
  @environment = :development
end

#development?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/biro/configuration.rb', line 17

def development?
  @environment == :development
end

#gateway(name, options = {}) ⇒ Object



21
22
23
24
25
26
# File 'lib/biro/configuration.rb', line 21

def gateway(name, options = {})
  klass_name = Biro::Utils.camelize(name.to_s) + '::Request'
  klass = Biro.const_get(klass_name)

  Biro.gateways[name] = klass.new(options)
end