Class: Apiwork::Introspection::Action
- Inherits:
-
Object
- Object
- Apiwork::Introspection::Action
- Defined in:
- lib/apiwork/introspection/action.rb,
lib/apiwork/introspection/action/request.rb,
lib/apiwork/introspection/action/response.rb
Overview
Wraps action definitions within a resource.
Defined Under Namespace
Instance Method Summary collapse
-
#deprecated? ⇒ Boolean
Whether this action is deprecated.
-
#description ⇒ String?
The description for this action.
-
#initialize(dump) ⇒ Action
constructor
A new instance of Action.
-
#method ⇒ Symbol
The method for this action.
-
#operation_id ⇒ String?
The operation ID for this action.
-
#path ⇒ String
The path for this action.
-
#raises ⇒ Array<Symbol>
The raises for this action.
-
#request ⇒ Action::Request
The request for this action.
-
#response ⇒ Action::Response
The response for this action.
-
#summary ⇒ String?
The summary for this action.
-
#tags ⇒ Array<String>
The tags for this action.
-
#to_h ⇒ Hash
Converts this action to a hash.
Constructor Details
#initialize(dump) ⇒ Action
Returns a new instance of Action.
20 21 22 |
# File 'lib/apiwork/introspection/action.rb', line 20 def initialize(dump) @dump = dump end |
Instance Method Details
#deprecated? ⇒ Boolean
Whether this action is deprecated.
100 101 102 |
# File 'lib/apiwork/introspection/action.rb', line 100 def deprecated? @dump[:deprecated] end |
#description ⇒ String?
The description for this action.
76 77 78 |
# File 'lib/apiwork/introspection/action.rb', line 76 def description @dump[:description] end |
#method ⇒ Symbol
The method for this action.
36 37 38 |
# File 'lib/apiwork/introspection/action.rb', line 36 def method @dump[:method] end |
#operation_id ⇒ String?
The operation ID for this action.
92 93 94 |
# File 'lib/apiwork/introspection/action.rb', line 92 def operation_id @dump[:operation_id] end |
#path ⇒ String
The path for this action.
28 29 30 |
# File 'lib/apiwork/introspection/action.rb', line 28 def path @dump[:path] end |
#raises ⇒ Array<Symbol>
The raises for this action.
60 61 62 |
# File 'lib/apiwork/introspection/action.rb', line 60 def raises @dump[:raises] end |
#request ⇒ Action::Request
The request for this action.
44 45 46 |
# File 'lib/apiwork/introspection/action.rb', line 44 def request @request ||= Request.new(@dump[:request]) end |
#response ⇒ Action::Response
The response for this action.
52 53 54 |
# File 'lib/apiwork/introspection/action.rb', line 52 def response @response ||= Response.new(@dump[:response]) end |
#summary ⇒ String?
The summary for this action.
68 69 70 |
# File 'lib/apiwork/introspection/action.rb', line 68 def summary @dump[:summary] end |
#tags ⇒ Array<String>
The tags for this action.
84 85 86 |
# File 'lib/apiwork/introspection/action.rb', line 84 def @dump[:tags] end |
#to_h ⇒ Hash
Converts this action to a hash.
108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
# File 'lib/apiwork/introspection/action.rb', line 108 def to_h { deprecated: deprecated?, description: description, method: method, operation_id: operation_id, path: path, raises: raises, request: request.to_h, response: response.to_h, summary: summary, tags: , } end |