Sha256: 4d9fa56ef356c3072ec9261460b013aa7d16bd7d64c10556c428f652ecee3242

Contents?: true

Size: 403 Bytes

Versions: 20

Compression:

Stored size: 403 Bytes

Contents

require_relative "./util"
require_relative "./server"

module Swagger
  class Schema
    module HandleServers
      def servers
        Util.try_hash(@schema, :servers)
      end

      def server(index)
        Server.new(servers[index])
      end

      def server_by_description(description)
        Server.new(servers.find { |server| server.description == description })
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
swagger-serializer-0.9.1 lib/swagger/schema/handle_servers.rb
swagger-serializer-0.9.0 lib/swagger/schema/handle_servers.rb
swagger-serializer-0.8.3 lib/swagger/schema/handle_servers.rb
swagger-serializer-0.8.2 lib/swagger/schema/handle_servers.rb
swagger-serializer-0.8.1 lib/swagger/schema/handle_servers.rb
swagger-serializer-0.8.0 lib/swagger/schema/handle_servers.rb
swagger-serializer-0.7.0 lib/swagger/schema/handle_servers.rb
swagger-serializer-0.6.2 lib/swagger/schema/handle_servers.rb
swagger-serializer-0.6.1 lib/swagger/schema/handle_servers.rb
swagger-serializer-0.6.0 lib/swagger/schema/handle_servers.rb
swagger-serializer-0.5.2 lib/swagger/schema/handle_servers.rb
swagger-serializer-0.5.1 lib/swagger/schema/handle_servers.rb
swagger-serializer-0.5.0 lib/swagger/schema/handle_servers.rb
swagger-serializer-0.4.1 lib/swagger/schema/handle_servers.rb
swagger-serializer-0.4.0 lib/swagger/schema/handle_servers.rb
swagger-serializer-0.3.0 lib/swagger/schema/handle_servers.rb
swagger-serializer-0.2.1 lib/swagger/schema/handle_servers.rb
swagger-serializer-0.2.0 lib/swagger/schema/handle_servers.rb
swagger-serializer-0.1.1 lib/swagger/schema/handle_servers.rb
swagger-serializer-0.1.0 lib/swagger/schema/handle_servers.rb