class PactBroker::Client::DescribeTextFormatter
Public Class Methods
call(properties)
click to toggle source
# File lib/pact_broker/client/describe_text_formatter.rb, line 9 def self.call(properties) YAML.dump(displayify_keys(properties)).gsub("---\n", "") end
displayify_keys(thing)
click to toggle source
# File lib/pact_broker/client/describe_text_formatter.rb, line 13 def self.displayify_keys(thing) case thing when Hash then thing.each_with_object({}) { | (key, value), new_hash | new_hash[generate_display_name(key)] = displayify_keys(value) } when Array then thing.collect{ | value | displayify_keys(value) } else thing end end