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.



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

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

#display_nameObject

Returns the value of attribute display_name.



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

def display_name
  @display_name
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



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

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

#response_codesObject



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

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