Class: Coppy::Steps::Base
- Inherits:
-
Object
- Object
- Coppy::Steps::Base
- Defined in:
- lib/coppy/steps/base.rb
Class Method Summary collapse
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(*args, &block) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(*args, &block) ⇒ Base
Returns a new instance of Base.
10 11 12 13 |
# File 'lib/coppy/steps/base.rb', line 10 def initialize(*args, &block) @args = args @given_block = block end |
Class Method Details
.wrap(&block) ⇒ Object
4 5 6 7 8 |
# File 'lib/coppy/steps/base.rb', line 4 def self.wrap(&block) Class.new(self) do define_method(:block, &block) end end |
Instance Method Details
#call(env) ⇒ Object
15 16 17 |
# File 'lib/coppy/steps/base.rb', line 15 def call(env) block(env, *@args, &@given_block) end |