Class: Raml::Method

Inherits:
Object
  • Object
show all
Defined in:
lib/raml/method.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(method) ⇒ Method

Returns a new instance of Method.



6
7
8
9
10
11
# File 'lib/raml/method.rb', line 6

def initialize(method)
  @method = method
  @responses = []
  @query_parameters = []
  @bodies = []
end

Instance Attribute Details

#bodiesObject

Returns the value of attribute bodies.



4
5
6
# File 'lib/raml/method.rb', line 4

def bodies
  @bodies
end

#descriptionObject

Returns the value of attribute description.



4
5
6
# File 'lib/raml/method.rb', line 4

def description
  @description
end

#headersObject

Returns the value of attribute headers.



4
5
6
# File 'lib/raml/method.rb', line 4

def headers
  @headers
end

#methodObject

Returns the value of attribute method.



4
5
6
# File 'lib/raml/method.rb', line 4

def method
  @method
end

#query_parametersObject

Returns the value of attribute query_parameters.



4
5
6
# File 'lib/raml/method.rb', line 4

def query_parameters
  @query_parameters
end

#responsesObject

Returns the value of attribute responses.



4
5
6
# File 'lib/raml/method.rb', line 4

def responses
  @responses
end

Instance Method Details

#content_typesObject



17
18
19
# File 'lib/raml/method.rb', line 17

def content_types
  responses.map {|response| response.content_type }.flatten.uniq
end

#response_codesObject



13
14
15
# File 'lib/raml/method.rb', line 13

def response_codes
  responses.map {|responses| response.code }
end