class HammerCLI::Output::Adapter::Yaml
Public Instance Methods
print_collection(fields, collection)
click to toggle source
# File lib/hammer_cli/output/adapter/yaml.rb, line 9 def print_collection(fields, collection) result = prepare_collection(fields, collection) output_stream.puts YAML.dump(result) end
print_message(msg, msg_params={})
click to toggle source
# File lib/hammer_cli/output/adapter/yaml.rb, line 14 def print_message(msg, msg_params={}) id = msg_params["id"] || msg_params[:id] name = msg_params["name"] || msg_params[:name] data = { :message => msg.format(msg_params) } data[:id] = id unless id.nil? data[:name] = name unless name.nil? puts YAML.dump(data) end
print_record(fields, record)
click to toggle source
# File lib/hammer_cli/output/adapter/yaml.rb, line 4 def print_record(fields, record) result = prepare_collection(fields, [record].flatten(1)) output_stream.puts YAML.dump(result.first) end