Class: Warp::ControllerMatchers::AssignMatcherBuilder
- Inherits:
-
Object
- Object
- Warp::ControllerMatchers::AssignMatcherBuilder
- Defined in:
- lib/warp/controller_matchers/assign_matcher.rb
Instance Attribute Summary collapse
-
#assign_key ⇒ Object
readonly
Returns the value of attribute assign_key.
-
#controller ⇒ Object
readonly
Returns the value of attribute controller.
Instance Method Summary collapse
-
#initialize(assign_key, controller) ⇒ AssignMatcherBuilder
constructor
A new instance of AssignMatcherBuilder.
- #method_missing(method, *args) ⇒ Object
- #with(value) ⇒ Object
- #with_a(klass) ⇒ Object
- #with_a_new(klass) ⇒ Object
Constructor Details
#initialize(assign_key, controller) ⇒ AssignMatcherBuilder
Returns a new instance of AssignMatcherBuilder.
8 9 10 11 |
# File 'lib/warp/controller_matchers/assign_matcher.rb', line 8 def initialize(assign_key, controller) @assign_key = assign_key @controller = controller end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args) ⇒ Object
25 26 27 |
# File 'lib/warp/controller_matchers/assign_matcher.rb', line 25 def method_missing(method, *args) matcher.send(method, *args) end |
Instance Attribute Details
#assign_key ⇒ Object (readonly)
Returns the value of attribute assign_key.
6 7 8 |
# File 'lib/warp/controller_matchers/assign_matcher.rb', line 6 def assign_key @assign_key end |
#controller ⇒ Object (readonly)
Returns the value of attribute controller.
6 7 8 |
# File 'lib/warp/controller_matchers/assign_matcher.rb', line 6 def controller @controller end |
Instance Method Details
#with(value) ⇒ Object
13 14 15 |
# File 'lib/warp/controller_matchers/assign_matcher.rb', line 13 def with(value) AssignWithMatcher.new(@controller, @assign_key, value) end |
#with_a(klass) ⇒ Object
17 18 19 |
# File 'lib/warp/controller_matchers/assign_matcher.rb', line 17 def with_a(klass) AssignWithAMatcher.new(@controller, @assign_key, klass) end |
#with_a_new(klass) ⇒ Object
21 22 23 |
# File 'lib/warp/controller_matchers/assign_matcher.rb', line 21 def with_a_new(klass) AssignWithANewMatcher.new(@controller, @assign_key, klass) end |