Class: RedSnow::Payload Abstract
- Inherits:
-
NamedBlueprintNode
- Object
- BlueprintNode
- NamedBlueprintNode
- RedSnow::Payload
- 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
-
#body ⇒ String
HTTP-message body or nil.
-
#headers ⇒ Headers
array of HTTP header fields of the message or nil.
-
#parameters ⇒ Array
ignored.
-
#reference ⇒ Hash
Symbol Reference if the payload is a reference.
-
#schema ⇒ String
HTTP-message body validation schema or nil.
Attributes inherited from NamedBlueprintNode
Instance Method Summary collapse
-
#initialize(sc_payload_handle_resource) ⇒ Payload
constructor
A new instance of Payload.
Methods inherited from NamedBlueprintNode
Constructor Details
#initialize(sc_payload_handle_resource) ⇒ Payload
Returns a new instance of Payload.
216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 |
# File 'lib/redsnow/blueprint.rb', line 216 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_reference_handle_payload = RedSnow::Binding.sc_reference_handle_payload(sc_payload_handle_resource) sc_reference_id = RedSnow::Binding.sc_reference_id(sc_reference_handle_payload) unless sc_reference_id.empty? @reference = ReferenceNode.new(sc_reference_id) end 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
#body ⇒ String
HTTP-message body or nil
209 210 211 |
# File 'lib/redsnow/blueprint.rb', line 209 def body @body end |
#headers ⇒ Headers
array of HTTP header fields of the message or nil
209 210 211 |
# File 'lib/redsnow/blueprint.rb', line 209 def headers @headers end |
#parameters ⇒ Array
ignored
209 210 211 |
# File 'lib/redsnow/blueprint.rb', line 209 def parameters @parameters end |
#reference ⇒ Hash
Symbol Reference if the payload is a reference
209 210 211 |
# File 'lib/redsnow/blueprint.rb', line 209 def reference @reference end |
#schema ⇒ String
HTTP-message body validation schema or nil
209 210 211 |
# File 'lib/redsnow/blueprint.rb', line 209 def schema @schema end |