class Swagger::V2::Path

Class representing a Swagger “Path Item Object”. @see github.com/wordnik/swagger-spec/blob/master/versions/2.0.md#pathItemObject Path Item Object

Constants

VERBS

Public Class Methods

new(hash) click to toggle source
Calls superclass method Swagger::SwaggerObject::new
# File lib/swagger/v2/path.rb, line 18
def initialize(hash)
  hash[:parameters] ||= []
  super
end

Public Instance Methods

each_parameter() { |parameter| ... } click to toggle source

Iterates over each Path level parameter.

# File lib/swagger/v2/path.rb, line 39
def each_parameter
  return if parameters.nil?
  parameters.each do |parameter|
    yield parameter
  end
end
operations() click to toggle source
# File lib/swagger/v2/path.rb, line 23
def operations
  VERBS.each_with_object({}) do |v, h|
    operation = send v
    h[v] = operation if operation
  end
end
path() click to toggle source
# File lib/swagger/v2/path.rb, line 34
def path
  parent.paths.key self
end
uri_template() click to toggle source
# File lib/swagger/v2/path.rb, line 30
def uri_template
  "#{parent.host}#{parent.base_path}#{path}"
end