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