Class: RedSnow::Sourcemap::Action

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

Overview

Action 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) ⇒ Action

Returns a new instance of Action.

Parameters:

  • sourcemap (json)


178
179
180
181
182
183
184
185
186
187
188
189
190
# File 'lib/redsnow/sourcemap.rb', line 178

def initialize(sourcemap)
  return if sourcemap.nil?

  super(sourcemap)

  @method = SourceMap.new(sourcemap['method'])
  @parameters = Parameters.new(sourcemap['parameters'])

  @examples = []
  sourcemap.key?('examples') && sourcemap['examples'].each do |example|
    @examples << TransactionExample.new(example)
  end
end

Instance Attribute Details

#examplesArray<TransactionExample>

action transaction examples

Returns:



172
173
174
# File 'lib/redsnow/sourcemap.rb', line 172

def examples
  @examples
end

#methodSourcemap

HTTP request method or nil

Returns:

  • (Sourcemap)

    the current value of method



172
173
174
# File 'lib/redsnow/sourcemap.rb', line 172

def method
  @method
end

#parametersParameters

action-specific URI parameters or nil

Returns:

  • (Parameters)

    the current value of parameters



172
173
174
# File 'lib/redsnow/sourcemap.rb', line 172

def parameters
  @parameters
end