Class: HammerCLI::Output::Adapter::Base
- Inherits:
-
Abstract
- Object
- Abstract
- HammerCLI::Output::Adapter::Base
show all
- Defined in:
- lib/hammer_cli/output/adapter/base.rb
Constant Summary
collapse
- GROUP_INDENT =
" "*4
- LABEL_DIVIDER =
": "
Instance Method Summary
collapse
Methods inherited from Abstract
#initialize, #paginate_by_default?, #print_error, #print_message
Instance Method Details
#print_collection(fields, collection) ⇒ Object
15
16
17
18
19
20
|
# File 'lib/hammer_cli/output/adapter/base.rb', line 15
def print_collection(fields, collection)
collection.each do |data|
output_stream.puts render_fields(fields, data)
output_stream.puts
end
end
|
#print_record(fields, record) ⇒ Object
11
12
13
|
# File 'lib/hammer_cli/output/adapter/base.rb', line 11
def print_record(fields, record)
print_collection(fields, [record].flatten(1))
end
|
7
8
9
|
# File 'lib/hammer_cli/output/adapter/base.rb', line 7
def tags
[:flat, :screen]
end
|