class Pact::ConsumerContract::Message::Contents

Public Class Methods

from_hash(contents, options = {}) click to toggle source

Could technically be an array

# File lib/pact/consumer_contract/message/contents.rb, line 9
def self.from_hash contents, options = {}
  new(contents)
end
new(contents) click to toggle source
# File lib/pact/consumer_contract/message/contents.rb, line 13
def initialize contents
  @contents = contents
end

Public Instance Methods

as_json() click to toggle source
# File lib/pact/consumer_contract/message/contents.rb, line 29
def as_json
  @contents
end
contents() click to toggle source
# File lib/pact/consumer_contract/message/contents.rb, line 25
def contents
  @contents
end
to_s() click to toggle source
# File lib/pact/consumer_contract/message/contents.rb, line 17
def to_s
  if @contents.is_a?(Hash) || @contents.is_a?(Array)
    @contents.to_json
  else
    @contents.to_s
  end
end