Class: RedSnow::Payload Abstract

Inherits:
NamedBlueprintNode show all
Defined in:
lib/redsnow/blueprint.rb

Overview

This class is abstract.

HTTP message payload Blueprint AST node

base class for 'payload sections'

Instance Attribute Summary collapse

Attributes inherited from NamedBlueprintNode

#description, #name

Instance Method Summary collapse

Methods inherited from NamedBlueprintNode

#ensure_description_newlines

Constructor Details

#initialize(sc_payload_handle_resource) ⇒ Payload

Returns a new instance of Payload.

Parameters:

  • sc_payload_handle_resource (FFI::Pointer)


197
198
199
200
201
202
203
204
205
# File 'lib/redsnow/blueprint.rb', line 197

def initialize(sc_payload_handle_resource)
  @name = RedSnow::Binding.sc_payload_name(sc_payload_handle_resource)
  @description = RedSnow::Binding.sc_payload_description(sc_payload_handle_resource)
  @body = RedSnow::Binding.sc_payload_body(sc_payload_handle_resource)
  @schema = RedSnow::Binding.sc_payload_schema(sc_payload_handle_resource)

  sc_header_collection_handle_payload = RedSnow::Binding.sc_header_collection_handle_payload(sc_payload_handle_resource)
  @headers = Headers.new(sc_header_collection_handle_payload)
end

Instance Attribute Details

#bodyString

HTTP-message body or nil

Returns:

  • (String)

    the current value of body



190
191
192
# File 'lib/redsnow/blueprint.rb', line 190

def body
  @body
end

#headersArray<Headers>

array of HTTP header fields of the message or nil

Returns:

  • (Array<Headers>)

    the current value of headers



190
191
192
# File 'lib/redsnow/blueprint.rb', line 190

def headers
  @headers
end

#parametersArray

ignored

Returns:

  • (Array)

    the current value of parameters



190
191
192
# File 'lib/redsnow/blueprint.rb', line 190

def parameters
  @parameters
end

#schemaString

HTTP-message body validation schema or nil

Returns:

  • (String)

    the current value of schema



190
191
192
# File 'lib/redsnow/blueprint.rb', line 190

def schema
  @schema
end