class Playtypus::Call

Attributes

body[RW]
headers[RW]
path[RW]
timestamp[RW]
verb[RW]

Public Class Methods

from_hash(hash) click to toggle source
# File lib/playtypus/call.rb, line 12
def self.from_hash(hash)
  return self.new(hash['timestamp'], hash['path'], hash['verb'], hash['headers'], hash['body'])
end
new(timestamp, path, verb, headers, body) click to toggle source
# File lib/playtypus/call.rb, line 16
def initialize(timestamp, path, verb, headers, body)
  @timestamp = Time.iso8601(timestamp)
  @path = path
  @verb = verb
  @headers = headers
  @body = body
end

Public Instance Methods

to_hash() click to toggle source
# File lib/playtypus/call.rb, line 24
def to_hash
  {
    'timestamp' => @timestamp,
    'path' => @path,
    'verb' => @verb,
    'headers' => @headers,
    'body' => @body
  }
end
to_s() click to toggle source
# File lib/playtypus/call.rb, line 34
def to_s
  self.to_hash.to_json
end