Class: HammerCLI::Output::Formatters::ListFormatter
Constant Summary
collapse
- INDENT =
" "
Instance Method Summary
collapse
inherited, #match?, #tags
Instance Method Details
117
118
119
120
121
122
123
124
125
126
127
128
129
130
|
# File 'lib/hammer_cli/output/formatters.rb', line 117
def format(list, field_params={})
if list.is_a? Array
separator = field_params.fetch(:separator, ', ')
new_line = field_params.fetch(:on_new_line, false)
list = list.join(separator)
list ="\n#{list.indent_with(INDENT)}" if new_line
list
elsif list
list.to_s
else
""
end
end
|
#required_features ⇒ Object
111
112
113
114
115
|
# File 'lib/hammer_cli/output/formatters.rb', line 111
def required_features
return %i[serialized] if tags.empty?
tags.map { |t| HammerCLI::Output::Utils.tag_to_feature(t) }
end
|