Class: Openapi3Parser::Nodes::Array
- Inherits:
-
Object
- Object
- Openapi3Parser::Nodes::Array
- Includes:
- Enumerable
- Defined in:
- lib/openapi3_parser/nodes/array.rb
Overview
An array within a OpenAPI document. Very similar to a normal Ruby array, however this is read only and knows the context of where it sits in an OpenAPI document
The contents of the data will be dependent on where this document is in the document hierachy.
Instance Attribute Summary collapse
-
#node_context ⇒ Object
readonly
Returns the value of attribute node_context.
-
#node_data ⇒ Object
readonly
Returns the value of attribute node_data.
Instance Method Summary collapse
- #[](value) ⇒ Object
- #each(&block) ⇒ Object
-
#initialize(data, context) ⇒ Array
constructor
A new instance of Array.
Constructor Details
#initialize(data, context) ⇒ Array
Returns a new instance of Array.
20 21 22 23 |
# File 'lib/openapi3_parser/nodes/array.rb', line 20 def initialize(data, context) @node_data = data @node_context = context end |
Instance Attribute Details
#node_context ⇒ Object (readonly)
Returns the value of attribute node_context.
16 17 18 |
# File 'lib/openapi3_parser/nodes/array.rb', line 16 def node_context @node_context end |
#node_data ⇒ Object (readonly)
Returns the value of attribute node_data.
16 17 18 |
# File 'lib/openapi3_parser/nodes/array.rb', line 16 def node_data @node_data end |
Instance Method Details
#[](value) ⇒ Object
25 26 27 |
# File 'lib/openapi3_parser/nodes/array.rb', line 25 def [](value) node_data[value] end |
#each(&block) ⇒ Object
29 30 31 |
# File 'lib/openapi3_parser/nodes/array.rb', line 29 def each(&block) node_data.each(&block) end |