Class: RedSnow::Sourcemap::Payload Abstract

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

Overview

This class is abstract.

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

Returns a new instance of Payload.

Parameters:

  • sourcemap (json)


131
132
133
134
135
136
137
138
139
140
# File 'lib/redsnow/sourcemap.rb', line 131

def initialize(sourcemap)
  return if sourcemap.nil?

  super(sourcemap)

  @body = SourceMap.new(sourcemap['body'])
  @schema = SourceMap.new(sourcemap['schema'])
  @reference = SourceMap.new(sourcemap['reference'])
  @headers = Headers.new(sourcemap['headers'])
end

Instance Attribute Details

#bodySourcemap

HTTP-message body or nil

Returns:



124
125
126
# File 'lib/redsnow/sourcemap.rb', line 124

def body
  @body
end

#headersHeaders

array of HTTP header fields of the message or nil

Returns:

  • (Headers)

    the current value of headers



124
125
126
# File 'lib/redsnow/sourcemap.rb', line 124

def headers
  @headers
end

#parametersParameters

ignored

Returns:

  • (Parameters)

    the current value of parameters



124
125
126
# File 'lib/redsnow/sourcemap.rb', line 124

def parameters
  @parameters
end

#referenceSourcemap

Symbol Reference sourcemap if the payload is a reference

Returns:

  • (Sourcemap)

    the current value of reference



124
125
126
# File 'lib/redsnow/sourcemap.rb', line 124

def reference
  @reference
end

#schemaSourcemap

HTTP-message body validation schema or nil

Returns:

  • (Sourcemap)

    the current value of schema



124
125
126
# File 'lib/redsnow/sourcemap.rb', line 124

def schema
  @schema
end