Class: Rage::OpenAPI::Nodes::Method

Inherits:
Object
  • Object
show all
Defined in:
lib/rage/openapi/nodes/method.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(controller, action, parents) ⇒ Method

Returns a new instance of Method.



8
9
10
11
12
13
14
15
# File 'lib/rage/openapi/nodes/method.rb', line 8

def initialize(controller, action, parents)
  @controller = controller
  @action = action
  @parents = parents

  @responses = {}
  @parameters = []
end

Instance Attribute Details

#actionObject (readonly)

Returns the value of attribute action.



4
5
6
# File 'lib/rage/openapi/nodes/method.rb', line 4

def action
  @action
end

#controllerObject (readonly)

Returns the value of attribute controller.



4
5
6
# File 'lib/rage/openapi/nodes/method.rb', line 4

def controller
  @controller
end

#deprecatedObject

Returns the value of attribute deprecated.



5
6
7
# File 'lib/rage/openapi/nodes/method.rb', line 5

def deprecated
  @deprecated
end

#descriptionObject

Returns the value of attribute description.



5
6
7
# File 'lib/rage/openapi/nodes/method.rb', line 5

def description
  @description
end

#http_methodObject

Returns the value of attribute http_method.



5
6
7
# File 'lib/rage/openapi/nodes/method.rb', line 5

def http_method
  @http_method
end

#http_pathObject

Returns the value of attribute http_path.



5
6
7
# File 'lib/rage/openapi/nodes/method.rb', line 5

def http_path
  @http_path
end

#parametersObject

Returns the value of attribute parameters.



5
6
7
# File 'lib/rage/openapi/nodes/method.rb', line 5

def parameters
  @parameters
end

#parentsObject (readonly)

Returns the value of attribute parents.



4
5
6
# File 'lib/rage/openapi/nodes/method.rb', line 4

def parents
  @parents
end

#privateObject

Returns the value of attribute private.



5
6
7
# File 'lib/rage/openapi/nodes/method.rb', line 5

def private
  @private
end

#requestObject

Returns the value of attribute request.



5
6
7
# File 'lib/rage/openapi/nodes/method.rb', line 5

def request
  @request
end

#responsesObject

Returns the value of attribute responses.



5
6
7
# File 'lib/rage/openapi/nodes/method.rb', line 5

def responses
  @responses
end

#summaryObject

Returns the value of attribute summary.



5
6
7
# File 'lib/rage/openapi/nodes/method.rb', line 5

def summary
  @summary
end

#tagObject

Returns the value of attribute tag.



5
6
7
# File 'lib/rage/openapi/nodes/method.rb', line 5

def tag
  @tag
end

Instance Method Details

#authObject



21
22
23
# File 'lib/rage/openapi/nodes/method.rb', line 21

def auth
  @parents.flat_map(&:auth)
end

#rootObject



17
18
19
# File 'lib/rage/openapi/nodes/method.rb', line 17

def root
  @parents[0].root
end