Class: OpenApi::Server
- Inherits:
-
Object
- Object
- OpenApi::Server
- Includes:
- EquatableAsContent
- Defined in:
- lib/open_api/server.rb
Overview
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#url ⇒ Object
Returns the value of attribute url.
-
#variables ⇒ Object
Returns the value of attribute variables.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(url:, description: nil, variables: nil) ⇒ Server
constructor
A new instance of Server.
Methods included from EquatableAsContent
Constructor Details
#initialize(url:, description: nil, variables: nil) ⇒ Server
Returns a new instance of Server.
8 9 10 11 12 |
# File 'lib/open_api/server.rb', line 8 def initialize(url:, description: nil, variables: nil) self.url = url self.description = description self.variables = variables end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
6 7 8 |
# File 'lib/open_api/server.rb', line 6 def description @description end |
#url ⇒ Object
Returns the value of attribute url.
6 7 8 |
# File 'lib/open_api/server.rb', line 6 def url @url end |
#variables ⇒ Object
Returns the value of attribute variables.
6 7 8 |
# File 'lib/open_api/server.rb', line 6 def variables @variables end |
Class Method Details
.load(hash) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/open_api/server.rb', line 14 def self.load(hash) new( url: hash["url"].to_s, description: hash["description"]&.to_s, variables: hash["variables"]&.map { |h| ServerVariable.load(h) } ) end |