class PactBroker::Client::Versions::TextFormatter
Constants
- Line
- OPTIONS
Public Class Methods
call(version_hash)
click to toggle source
# File lib/pact_broker/client/versions/text_formatter.rb, line 17 def self.call(version_hash) tags = (lookup(version_hash, [], :_embedded, :tags) || []).collect{ | t| t[:name] }.join(" ") data = Line.new(version_hash[:number], tags) printer = TablePrint::Printer.new([data], OPTIONS) printer.table_print end
lookup(line, default, *keys)
click to toggle source
# File lib/pact_broker/client/versions/text_formatter.rb, line 25 def self.lookup line, default, *keys keys.reduce(line) { | line, key | line[key] } rescue NoMethodError default end