Class: Gitlab::GrapeOpenapi::Models::ServerVariable
- Inherits:
-
Object
- Object
- Gitlab::GrapeOpenapi::Models::ServerVariable
- Defined in:
- lib/gitlab/grape_openapi/models/server_variable.rb
Overview
Instance Attribute Summary collapse
-
#default ⇒ Object
readonly
Returns the value of attribute default.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#enum ⇒ Object
readonly
Returns the value of attribute enum.
Instance Method Summary collapse
-
#initialize(default:, description: nil, enum: nil) ⇒ ServerVariable
constructor
A new instance of ServerVariable.
- #to_h ⇒ Object
Constructor Details
#initialize(default:, description: nil, enum: nil) ⇒ ServerVariable
Returns a new instance of ServerVariable.
10 11 12 13 14 |
# File 'lib/gitlab/grape_openapi/models/server_variable.rb', line 10 def initialize(default:, description: nil, enum: nil) @default = default @description = description @enum = enum end |
Instance Attribute Details
#default ⇒ Object (readonly)
Returns the value of attribute default.
8 9 10 |
# File 'lib/gitlab/grape_openapi/models/server_variable.rb', line 8 def default @default end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
8 9 10 |
# File 'lib/gitlab/grape_openapi/models/server_variable.rb', line 8 def description @description end |
#enum ⇒ Object (readonly)
Returns the value of attribute enum.
8 9 10 |
# File 'lib/gitlab/grape_openapi/models/server_variable.rb', line 8 def enum @enum end |
Instance Method Details
#to_h ⇒ Object
16 17 18 19 20 21 |
# File 'lib/gitlab/grape_openapi/models/server_variable.rb', line 16 def to_h hash = { default: default } hash[:description] = description if description.present? hash[:enum] = enum if enum.present? hash end |