Class: Openapi3Parser::NodeFactory::Map
- Inherits:
-
Object
- Object
- Openapi3Parser::NodeFactory::Map
- Defined in:
- lib/openapi3_parser/node_factory/map.rb
Direct Known Subclasses
Defined Under Namespace
Classes: ValidNodeBuilder
Instance Attribute Summary collapse
-
#allow_extensions ⇒ Object
readonly
Returns the value of attribute allow_extensions.
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#default ⇒ Object
readonly
Returns the value of attribute default.
-
#key_input_type ⇒ Object
readonly
Returns the value of attribute key_input_type.
-
#validation ⇒ Object
readonly
Returns the value of attribute validation.
-
#value_factory ⇒ Object
readonly
Returns the value of attribute value_factory.
-
#value_input_type ⇒ Object
readonly
Returns the value of attribute value_input_type.
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize(context, allow_extensions: false, default: {}, key_input_type: String, value_input_type: nil, value_factory: nil, validate: nil) ⇒ Map
constructor
rubocop:disable Metrics/ParameterLists.
- #inspect ⇒ Object
- #nil_input? ⇒ Boolean
- #node ⇒ Object
-
#raw_input ⇒ Object
rubocop:enable Metrics/ParameterLists.
- #resolved_input ⇒ Object
- #valid? ⇒ Boolean
Constructor Details
#initialize(context, allow_extensions: false, default: {}, key_input_type: String, value_input_type: nil, value_factory: nil, validate: nil) ⇒ Map
rubocop:disable Metrics/ParameterLists
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/openapi3_parser/node_factory/map.rb', line 19 def initialize( context, allow_extensions: false, default: {}, key_input_type: String, value_input_type: nil, value_factory: nil, validate: nil ) @context = context @allow_extensions = allow_extensions @default = default @key_input_type = key_input_type @value_input_type = value_input_type @value_factory = value_factory @validation = validate @data = build_data(context.input) end |
Instance Attribute Details
#allow_extensions ⇒ Object (readonly)
Returns the value of attribute allow_extensions.
14 15 16 |
# File 'lib/openapi3_parser/node_factory/map.rb', line 14 def allow_extensions @allow_extensions end |
#context ⇒ Object (readonly)
Returns the value of attribute context.
14 15 16 |
# File 'lib/openapi3_parser/node_factory/map.rb', line 14 def context @context end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
14 15 16 |
# File 'lib/openapi3_parser/node_factory/map.rb', line 14 def data @data end |
#default ⇒ Object (readonly)
Returns the value of attribute default.
14 15 16 |
# File 'lib/openapi3_parser/node_factory/map.rb', line 14 def default @default end |
#key_input_type ⇒ Object (readonly)
Returns the value of attribute key_input_type.
14 15 16 |
# File 'lib/openapi3_parser/node_factory/map.rb', line 14 def key_input_type @key_input_type end |
#validation ⇒ Object (readonly)
Returns the value of attribute validation.
14 15 16 |
# File 'lib/openapi3_parser/node_factory/map.rb', line 14 def validation @validation end |
#value_factory ⇒ Object (readonly)
Returns the value of attribute value_factory.
14 15 16 |
# File 'lib/openapi3_parser/node_factory/map.rb', line 14 def value_factory @value_factory end |
#value_input_type ⇒ Object (readonly)
Returns the value of attribute value_input_type.
14 15 16 |
# File 'lib/openapi3_parser/node_factory/map.rb', line 14 def value_input_type @value_input_type end |
Instance Method Details
#errors ⇒ Object
55 56 57 |
# File 'lib/openapi3_parser/node_factory/map.rb', line 55 def errors @errors ||= ValidNodeBuilder.errors(self) end |
#inspect ⇒ Object
66 67 68 |
# File 'lib/openapi3_parser/node_factory/map.rb', line 66 def inspect %{#{self.class.name}(#{context.source_location.inspect})} end |
#nil_input? ⇒ Boolean
47 48 49 |
# File 'lib/openapi3_parser/node_factory/map.rb', line 47 def nil_input? context.input.nil? end |
#node ⇒ Object
59 60 61 62 63 64 |
# File 'lib/openapi3_parser/node_factory/map.rb', line 59 def node @node ||= begin data = ValidNodeBuilder.data(self) data.nil? ? nil : build_node(data) end end |
#raw_input ⇒ Object
rubocop:enable Metrics/ParameterLists
39 40 41 |
# File 'lib/openapi3_parser/node_factory/map.rb', line 39 def raw_input context.input end |
#resolved_input ⇒ Object
43 44 45 |
# File 'lib/openapi3_parser/node_factory/map.rb', line 43 def resolved_input @resolved_input ||= build_resolved_input end |
#valid? ⇒ Boolean
51 52 53 |
# File 'lib/openapi3_parser/node_factory/map.rb', line 51 def valid? errors.empty? end |