Class: Gitlab::GrapeOpenapi::Models::Schema
- Inherits:
-
Object
- Object
- Gitlab::GrapeOpenapi::Models::Schema
- Defined in:
- lib/gitlab/grape_openapi/models/schema.rb
Overview
Instance Attribute Summary collapse
-
#properties ⇒ Object
Returns the value of attribute properties.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize ⇒ Schema
constructor
A new instance of Schema.
- #method_missing(method_name, *_args) ⇒ Object
- #respond_to_missing?(method_name, _include_private = false) ⇒ Boolean
- #to_h ⇒ Object
Constructor Details
#initialize ⇒ Schema
Returns a new instance of Schema.
10 11 12 |
# File 'lib/gitlab/grape_openapi/models/schema.rb', line 10 def initialize @properties = {} end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *_args) ⇒ Object
14 15 16 17 18 |
# File 'lib/gitlab/grape_openapi/models/schema.rb', line 14 def method_missing(method_name, *_args) raise NoMethodError unless respond_to_missing?(method_name) properties[method_name] end |
Instance Attribute Details
#properties ⇒ Object
Returns the value of attribute properties.
8 9 10 |
# File 'lib/gitlab/grape_openapi/models/schema.rb', line 8 def properties @properties end |
#type ⇒ Object
Returns the value of attribute type.
8 9 10 |
# File 'lib/gitlab/grape_openapi/models/schema.rb', line 8 def type @type end |
Instance Method Details
#respond_to_missing?(method_name, _include_private = false) ⇒ Boolean
20 21 22 |
# File 'lib/gitlab/grape_openapi/models/schema.rb', line 20 def respond_to_missing?(method_name, _include_private = false) properties.key?(method_name) end |
#to_h ⇒ Object
24 25 26 |
# File 'lib/gitlab/grape_openapi/models/schema.rb', line 24 def to_h build_schema_hash end |