Class: Command::Results::Formatter::FormatAdvisor
- Inherits:
-
Object
- Object
- Command::Results::Formatter::FormatAdvisor
- Defined in:
- lib/command-set/formatter/base.rb
Instance Method Summary collapse
-
#initialize(formatter) ⇒ FormatAdvisor
constructor
A new instance of FormatAdvisor.
- #item(&block) ⇒ Object
- #list(&block) ⇒ Object
- #output(&block) ⇒ Object
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 |