Class: LazyDoc::Commands::FinallyCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/lazy_doc/commands/finally_command.rb

Constant Summary collapse

NO_OP_TRANSFORMATION =
lambda { |value| value }

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#transformationObject (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