Class: RedSnow::Sourcemap::TransactionExample

Inherits:
NamedNode show all
Defined in:
lib/redsnow/sourcemap.rb

Overview

Transaction example source map node

Instance Attribute Summary collapse

Attributes inherited from NamedNode

#description, #name

Attributes inherited from Node

#collection

Instance Method Summary collapse

Constructor Details

#initialize(sourcemap) ⇒ TransactionExample

Returns a new instance of TransactionExample.

Parameters:

  • sourcemap (json)


152
153
154
155
156
157
158
159
160
161
162
163
164
# File 'lib/redsnow/sourcemap.rb', line 152

def initialize(sourcemap)
  super(sourcemap)

  @requests = []
  sourcemap.key?('requests') && sourcemap['requests'].each do |request|
    @requests << Payload.new(request)
  end

  @responses = []
  sourcemap.key?('responses') && sourcemap['responses'].each do |response|
    @responses << Payload.new(response)
  end
end

Instance Attribute Details

#requestsArray<Request>

example request payloads

Returns:

  • (Array<Request>)

    the current value of requests



147
148
149
# File 'lib/redsnow/sourcemap.rb', line 147

def requests
  @requests
end

#responseArray<Response>

example response payloads

Returns:

  • (Array<Response>)

    the current value of response



147
148
149
# File 'lib/redsnow/sourcemap.rb', line 147

def response
  @response
end

#responsesObject

Returns the value of attribute responses.



149
150
151
# File 'lib/redsnow/sourcemap.rb', line 149

def responses
  @responses
end