Class: HammerCLI::Output::Adapter::WrapperFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/hammer_cli/output/adapter/wrapper_formatter.rb

Instance Method Summary collapse

Constructor Details

#initialize(formatter, params) ⇒ WrapperFormatter

Returns a new instance of WrapperFormatter.



5
6
7
8
# File 'lib/hammer_cli/output/adapter/wrapper_formatter.rb', line 5

def initialize(formatter, params)
  @formatter = formatter
  @params = params
end

Instance Method Details

#format(value) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/hammer_cli/output/adapter/wrapper_formatter.rb', line 10

def format(value)
  if @formatter
    @formatter.format(value, @params)
  else
    value
  end
end