Class: Swagger::Schema::Server

Inherits:
Object
  • Object
show all
Extended by:
SchemaAccessor
Defined in:
lib/swagger/schema/server.rb

Instance Method Summary collapse

Constructor Details

#initialize(schema) ⇒ Server

Returns a new instance of Server.



9
10
11
# File 'lib/swagger/schema/server.rb', line 9

def initialize(schema)
  @schema = schema
end

Instance Method Details

#complete_url(url_variables = {}) ⇒ Object



15
16
17
18
19
20
21
22
# File 'lib/swagger/schema/server.rb', line 15

def complete_url(url_variables = {})
  use_url = url
  (variables || {}).each do |name, options|
    variable = Util.try_hash(url_variables, name) || Util.try_hash(options, :default)
    use_url.gsub!("{#{name}}", variable.to_s)
  end
  use_url
end