Class: Warp::ControllerMatchers::AssignMatcherBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/warp/controller_matchers/assign_matcher.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_keyObject (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

#controllerObject (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