mockserver-client-ruby/lib/mockserver/model/expectation.rb
# Creates an expectation from a hash
# @param payload [Hash] a hash representation of the expectation
Creates an expectation from a hash
Creates an expectation from a hash
def populate_from_payload(payload)
        @request = payload[MockServer::HTTP_REQUEST]
        @request = Request.new(symbolize_keys(@request)) if @request
        @response = payload[MockServer::HTTP_RESPONSE]
        @response = Response.new(symbolize_keys(@response)) if @response
        @forward = payload[MockServer::HTTP_FORWARD]
        @forward = Forward.new(symbolize_keys(@forward)) if @forward
        @times = payload[MockServer::HTTP_TIMES]
        @times = Times.new(symbolize_keys(@times)) if @times
      end
def populate_from_payload ( payload ) @request = payload [ MockServer :: HTTP_REQUEST ] @request = Request . new ( symbolize_keys ( @request ) ) if @request @response = payload [ MockServer :: HTTP_RESPONSE ] @response = Response . new ( symbolize_keys ( @response ) ) if @response @forward = payload [ MockServer :: HTTP_FORWARD ] @forward = Forward . new ( symbolize_keys ( @forward ) ) if @forward @times = payload [ MockServer :: HTTP_TIMES ] @times = Times . new ( symbolize_keys ( @times ) ) if @times end
Creates an expectation from a hash
Creates an expectation from a hash
payload
a hash representation of the expectation
a hash representation of the expectation