Class: OasParser::Parameter
Instance Attribute Summary collapse
Instance Method Summary
collapse
#allOf?, #array?, #collection?, #empty?, #enum, #has_xml_name?, #has_xml_options?, #is_xml_attribute?, #is_xml_text?, #name, #object?, #oneOf?, #properties, #subproperties_are_one_of_many?, #xml_name
included, #method_missing, #respond_to_missing?
Constructor Details
#initialize(owner, raw) ⇒ Parameter
Returns a new instance of Parameter.
8
9
10
11
12
|
# File 'lib/oas_parser/parameter.rb', line 8
def initialize(owner, raw)
super(raw['name'])
@owner = owner
@raw = raw
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class OasParser::RawAccessor
Instance Attribute Details
#owner ⇒ Object
Returns the value of attribute owner.
6
7
8
|
# File 'lib/oas_parser/parameter.rb', line 6
def owner
@owner
end
|
#raw ⇒ Object
Returns the value of attribute raw.
6
7
8
|
# File 'lib/oas_parser/parameter.rb', line 6
def raw
@raw
end
|
Instance Method Details
#convert_property_schema_to_properties(schema) ⇒ Object
38
39
40
41
42
|
# File 'lib/oas_parser/parameter.rb', line 38
def convert_property_schema_to_properties(schema)
schema.map do |name, definition|
OasParser::Property.new(self, raw, name, definition)
end
end
|
#default ⇒ Object
30
31
32
|
# File 'lib/oas_parser/parameter.rb', line 30
def default
raw['default'] || (schema ? schema['default'] : nil)
end
|
#example ⇒ Object
26
27
28
|
# File 'lib/oas_parser/parameter.rb', line 26
def example
raw['example'] || (schema ? schema['example'] : nil)
end
|
18
19
20
|
# File 'lib/oas_parser/parameter.rb', line 18
def format
raw['format'] || (schema ? schema['format'] : nil)
end
|
#items ⇒ Object
22
23
24
|
# File 'lib/oas_parser/parameter.rb', line 22
def items
schema['items']
end
|
#nullable? ⇒ Boolean
34
35
36
|
# File 'lib/oas_parser/parameter.rb', line 34
def nullable?
raw['nullable'] || (schema ? schema['nullable'] : nil )
end
|
#type ⇒ Object
14
15
16
|
# File 'lib/oas_parser/parameter.rb', line 14
def type
raw['type'] || (schema ? schema['type'] : nil)
end
|