Module: Openapi3Parser::Node::Object
- Includes:
- Enumerable
- Included in:
- Openapi3Parser::Nodes::Components, Openapi3Parser::Nodes::Contact, Openapi3Parser::Nodes::Discriminator, Openapi3Parser::Nodes::Encoding, Openapi3Parser::Nodes::Example, Openapi3Parser::Nodes::ExternalDocumentation, Openapi3Parser::Nodes::Header, Openapi3Parser::Nodes::Info, Openapi3Parser::Nodes::License, Openapi3Parser::Nodes::Link, Openapi3Parser::Nodes::MediaType, Openapi3Parser::Nodes::OauthFlow, Openapi3Parser::Nodes::OauthFlows, Openapi3Parser::Nodes::Openapi, Openapi3Parser::Nodes::Operation, Openapi3Parser::Nodes::Parameter, Openapi3Parser::Nodes::PathItem, Openapi3Parser::Nodes::RequestBody, Openapi3Parser::Nodes::Response, Openapi3Parser::Nodes::Schema, Openapi3Parser::Nodes::SecurityScheme, Openapi3Parser::Nodes::Server, Openapi3Parser::Nodes::ServerVariable, Openapi3Parser::Nodes::Tag, Openapi3Parser::Nodes::Xml
- Defined in:
- lib/openapi3_parser/node/object.rb
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
Look up an attribute of the node by the name it has in the OpenAPI document.
-
#each(&block) ⇒ Object
Iterate through the attributes of this object.
-
#extension(value) ⇒ Hash, ...
Look up an extension provided for this object, doesn’t need a prefix of “x-”.
- #initialize(data, context) ⇒ Object
Instance Attribute Details
#node_context ⇒ Object (readonly)
Returns the value of attribute node_context.
8 9 10 |
# File 'lib/openapi3_parser/node/object.rb', line 8 def node_context @node_context end |
#node_data ⇒ Object (readonly)
Returns the value of attribute node_data.
8 9 10 |
# File 'lib/openapi3_parser/node/object.rb', line 8 def node_data @node_data end |
Instance Method Details
#[](value) ⇒ Object
Look up an attribute of the node by the name it has in the OpenAPI document.
30 31 32 |
# File 'lib/openapi3_parser/node/object.rb', line 30 def [](value) node_data[value.to_s] end |
#each(&block) ⇒ Object
Iterate through the attributes of this object
48 49 50 |
# File 'lib/openapi3_parser/node/object.rb', line 48 def each(&block) node_data.each(&block) end |
#extension(value) ⇒ Hash, ...
Look up an extension provided for this object, doesn’t need a prefix of “x-”
43 44 45 |
# File 'lib/openapi3_parser/node/object.rb', line 43 def extension(value) node_data["x-#{value}"] end |
#initialize(data, context) ⇒ Object
10 11 12 13 |
# File 'lib/openapi3_parser/node/object.rb', line 10 def initialize(data, context) @node_data = data @node_context = context end |