Module: Dipswitch

Defined in:
lib/dipswitch.rb,
lib/dipswitch/feature.rb,
lib/dipswitch/version.rb,
lib/dipswitch/features.rb,
lib/dipswitch/configuration.rb

Defined Under Namespace

Classes: Configuration, Feature, Features

Constant Summary collapse

VERSION =
"0.1.1"

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.clear!Object



21
22
23
# File 'lib/dipswitch/configuration.rb', line 21

def self.clear!
  configuration.clear!
end

.configurationObject



8
9
10
# File 'lib/dipswitch/configuration.rb', line 8

def self.configuration
  @configuration ||= Configuration.new
end

.configure {|configuration| ... } ⇒ Object

Yields:



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

def self.configure(&block)
  yield configuration
  # configuration.freeze
end

.on?(name, *args) ⇒ Boolean

Returns:

  • (Boolean)


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

def self.on?(name, *args)
  # TODO: Not loving this so much. Maybe simplify
  configuration.features.on?(name, *args)
end

.with(name, *args, &block) ⇒ Object



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

def self.with(name, *args, &block)
  configuration.features.with(name, *args, &block)
end

Instance Method Details

#configurationObject



12
13
14
# File 'lib/dipswitch.rb', line 12

def configuration
  @configuration ||= Configuration.new
end

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

Yields:



8
9
10
# File 'lib/dipswitch.rb', line 8

def configure(&block)
  yield configuration
end