Class: Juknife::Request::Runner
- Inherits:
-
Object
- Object
- Juknife::Request::Runner
- Includes:
- DSL
- Defined in:
- lib/juknife/request/runner.rb
Overview
Juknife::Request::Runner object is a runner for request DSL.
Constant Summary
Constants included from DSL
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Attributes included from DSL
#body_builder, #http_method, #query_builder, #url_builder, #user_agent_builder
Instance Method Summary collapse
-
#initialize(&block) ⇒ Runner
constructor
A new instance of Runner.
- #run(params = {}) ⇒ Object
- #source ⇒ Object
Methods included from DSL
Constructor Details
#initialize(&block) ⇒ Runner
Returns a new instance of Runner.
12 13 14 15 |
# File 'lib/juknife/request/runner.rb', line 12 def initialize(&block) @block = block instance_eval(&@block) end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
10 11 12 |
# File 'lib/juknife/request/runner.rb', line 10 def block @block end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
10 11 12 |
# File 'lib/juknife/request/runner.rb', line 10 def params @params end |
Instance Method Details
#run(params = {}) ⇒ Object
17 18 19 20 |
# File 'lib/juknife/request/runner.rb', line 17 def run(params = {}) @params = params source end |
#source ⇒ Object
22 23 24 |
# File 'lib/juknife/request/runner.rb', line 22 def source @source ||= response.body end |