Class: Command::Results::Formatter::FormatAdvisor

Inherits:
Object
  • Object
show all
Defined in:
lib/command-set/formatter/base.rb

Instance Method Summary collapse

Constructor Details

#initialize(formatter) ⇒ FormatAdvisor

Returns a new instance of FormatAdvisor.



62
63
64
# File 'lib/command-set/formatter/base.rb', line 62

def initialize(formatter)
  @advisee = formatter
end

Instance Method Details

#item(&block) ⇒ Object



70
71
72
# File 'lib/command-set/formatter/base.rb', line 70

def item(&block)
  @advisee.advice[:item] << proc(&block)
end

#list(&block) ⇒ Object



66
67
68
# File 'lib/command-set/formatter/base.rb', line 66

def list(&block)
  @advisee.advice[:list] << proc(&block)
end

#output(&block) ⇒ Object



74
75
76
# File 'lib/command-set/formatter/base.rb', line 74

def output(&block)
  @advisee.advice[:output] << proc(&block)
end