Class: Dolphin::DSL

Inherits:
Object
  • Object
show all
Defined in:
lib/dolphin/dsl.rb

Instance Method Summary collapse

Constructor Details

#initialize(flipper_store, &block) ⇒ DSL


6
7
8
9
# File 'lib/dolphin/dsl.rb', line 6

def initialize(flipper_store, &block)
  @flipper_store = flipper_store
  instance_eval(&block)
end

Instance Method Details

#flipper(name, &block) ⇒ Object


11
12
13
14
# File 'lib/dolphin/dsl.rb', line 11

def flipper(name, &block)
  raise unless block_given?
  @flipper_store.flippers[name.to_s] = block
end