Class: Spine::Transform::Commands::Intercept
- Inherits:
-
Object
- Object
- Spine::Transform::Commands::Intercept
- Defined in:
- lib/spine/transform/commands/intercept.rb
Instance Method Summary collapse
- #execute(destination, value) ⇒ Object
-
#initialize(key, action, options = {}) ⇒ Intercept
constructor
A new instance of Intercept.
Constructor Details
#initialize(key, action, options = {}) ⇒ Intercept
Returns a new instance of Intercept.
5 6 7 8 |
# File 'lib/spine/transform/commands/intercept.rb', line 5 def initialize(key, action, = {}) @key = .fetch(:to, key) @action = action end |
Instance Method Details
#execute(destination, value) ⇒ Object
10 11 12 |
# File 'lib/spine/transform/commands/intercept.rb', line 10 def execute(destination, value) destination[@key] = @action.call(value) end |