Sha256: 91d4fa2626d0b418dd09030625cb4eccf1935167e8eaf03c4c845ef97f877f12
Contents?: true
Size: 701 Bytes
Versions: 4
Compression:
Stored size: 701 Bytes
Contents
require 'sanford-protocol' require 'and-son/response' module AndSon class StoredResponses RequestData = Struct.new(:name, :params) def initialize @hash = {} end def add(name, params = nil) request_data = RequestData.new(name, params || {}) response = yield if !response.kind_of?(Sanford::Protocol::Response) response = Sanford::Protocol::Response.new(200, response) end @hash[request_data] = AndSon::Response.new(response) end def find(name, params = nil) @hash[RequestData.new(name, params || {})] end def remove(name, params = nil) @hash.delete(RequestData.new(name, params || {})) end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
and-son-0.4.0 | lib/and-son/stored_responses.rb |
and-son-0.3.1 | lib/and-son/stored_responses.rb |
and-son-0.3.0 | lib/and-son/stored_responses.rb |
and-son-0.2.1 | lib/and-son/stored_responses.rb |