Class: Setka::Workflow::Resource
- Inherits:
-
Object
- Object
- Setka::Workflow::Resource
- Defined in:
- lib/setka/workflow/resource.rb
Class Method Summary collapse
- .actual_client(options) ⇒ Object
-
.collection(http_verb, action = nil, body = nil, options) ⇒ Object
Abstract operation’s execution over a collection of a resource.
-
.member(http_verb, id, action = nil, body = nil, options) ⇒ Object
Abstract operation’s execution over a member of a resource.
Class Method Details
.actual_client(options) ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/setka/workflow/resource.rb', line 17 def actual_client() if [:client] raise ConfigurationError.new('Wrong client is specified') unless [:client].is_a?(Setka::Workflow::Client) [:client] else Setka::Workflow.client end end |
.collection(http_verb, action = nil, body = nil, options) ⇒ Object
Abstract operation’s execution over a collection of a resource.
13 14 15 |
# File 'lib/setka/workflow/resource.rb', line 13 def collection(http_verb, action = nil, body = nil, ) actual_client().send(http_verb, path(action), body, ) end |
.member(http_verb, id, action = nil, body = nil, options) ⇒ Object
Abstract operation’s execution over a member of a resource.
7 8 9 |
# File 'lib/setka/workflow/resource.rb', line 7 def member(http_verb, id, action = nil, body = nil, ) actual_client().send(http_verb, path(action, id), body, ) end |