Class: LazyDoc::Commands::FinallyCommand
- Inherits:
-
Object
- Object
- LazyDoc::Commands::FinallyCommand
- Defined in:
- lib/lazy_doc/commands/finally_command.rb
Constant Summary collapse
- NO_OP_TRANSFORMATION =
lambda { |value| value }
Instance Attribute Summary collapse
-
#transformation ⇒ Object
readonly
Returns the value of attribute transformation.
Instance Method Summary collapse
- #execute(value) ⇒ Object
-
#initialize(transformation) ⇒ FinallyCommand
constructor
A new instance of FinallyCommand.
Constructor Details
#initialize(transformation) ⇒ FinallyCommand
Returns a new instance of FinallyCommand.
7 8 9 |
# File 'lib/lazy_doc/commands/finally_command.rb', line 7 def initialize(transformation) @transformation = transformation || NO_OP_TRANSFORMATION end |
Instance Attribute Details
#transformation ⇒ Object (readonly)
Returns the value of attribute transformation.
3 4 5 |
# File 'lib/lazy_doc/commands/finally_command.rb', line 3 def transformation @transformation end |
Instance Method Details
#execute(value) ⇒ Object
11 12 13 |
# File 'lib/lazy_doc/commands/finally_command.rb', line 11 def execute(value) transformation.call(value) end |