Class: RR::DoubleDefinitions::DoubleDefinition
- Inherits:
-
Object
- Object
- RR::DoubleDefinitions::DoubleDefinition
- Includes:
- ArgumentDefinitionConstructionMethods, DefinitionConstructionMethods, StateQueryMethods, TimesDefinitionConstructionMethods, Space::Reader
- Defined in:
- lib/rr/double_definitions/double_definition.rb
Overview
:nodoc:
Defined Under Namespace
Modules: ArgumentDefinitionConstructionMethods, DefinitionConstructionMethods, StateQueryMethods, TimesDefinitionConstructionMethods
Constant Summary collapse
- ORIGINAL_METHOD =
Object.new
Instance Attribute Summary collapse
-
#after_call_proc ⇒ Object
Returns the value of attribute after_call_proc.
-
#argument_expectation ⇒ Object
Returns the value of attribute argument_expectation.
-
#double ⇒ Object
Returns the value of attribute double.
-
#double_definition_creator ⇒ Object
Returns the value of attribute double_definition_creator.
-
#implementation ⇒ Object
Returns the value of attribute implementation.
-
#subject ⇒ Object
Returns the value of attribute subject.
-
#times_matcher ⇒ Object
Returns the value of attribute times_matcher.
-
#yields_value ⇒ Object
Returns the value of attribute yields_value.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(double_definition_creator, subject) ⇒ DoubleDefinition
constructor
A new instance of DoubleDefinition.
- #root_subject ⇒ Object
Methods included from StateQueryMethods
#exact_match?, #expected_arguments, #implementation_is_original_method?, #ordered?, #terminal?, #verbose?, #verify_method_signature?, #wildcard_match?
Methods included from DefinitionConstructionMethods
#after_call, #implemented_by, #implemented_by_original_method, #ordered, #returns, #verbose, #verify_method_signature, #yields
Methods included from TimesDefinitionConstructionMethods
#any_number_of_times, #at_least, #at_most, #never, #once, #times, #twice
Methods included from ArgumentDefinitionConstructionMethods
#with, #with_any_args, #with_no_args
Methods included from Space::Reader
Constructor Details
#initialize(double_definition_creator, subject) ⇒ DoubleDefinition
Returns a new instance of DoubleDefinition.
34 35 36 37 38 39 40 41 42 |
# File 'lib/rr/double_definitions/double_definition.rb', line 34 def initialize(double_definition_creator, subject) @implementation = nil @argument_expectation = nil @times_matcher = nil @after_call_proc = nil @yields_value = nil @double_definition_creator = double_definition_creator @subject = subject end |
Instance Attribute Details
#after_call_proc ⇒ Object
Returns the value of attribute after_call_proc.
21 22 23 |
# File 'lib/rr/double_definitions/double_definition.rb', line 21 def after_call_proc @after_call_proc end |
#argument_expectation ⇒ Object
Returns the value of attribute argument_expectation.
21 22 23 |
# File 'lib/rr/double_definitions/double_definition.rb', line 21 def argument_expectation @argument_expectation end |
#double ⇒ Object
Returns the value of attribute double.
21 22 23 |
# File 'lib/rr/double_definitions/double_definition.rb', line 21 def double @double end |
#double_definition_creator ⇒ Object
Returns the value of attribute double_definition_creator.
21 22 23 |
# File 'lib/rr/double_definitions/double_definition.rb', line 21 def double_definition_creator @double_definition_creator end |
#implementation ⇒ Object
Returns the value of attribute implementation.
21 22 23 |
# File 'lib/rr/double_definitions/double_definition.rb', line 21 def implementation @implementation end |
#subject ⇒ Object
Returns the value of attribute subject.
21 22 23 |
# File 'lib/rr/double_definitions/double_definition.rb', line 21 def subject @subject end |
#times_matcher ⇒ Object
Returns the value of attribute times_matcher.
21 22 23 |
# File 'lib/rr/double_definitions/double_definition.rb', line 21 def times_matcher @times_matcher end |
#yields_value ⇒ Object
Returns the value of attribute yields_value.
21 22 23 |
# File 'lib/rr/double_definitions/double_definition.rb', line 21 def yields_value @yields_value end |
Class Method Details
.register_strategy_class(strategy_class, method_name) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/rr/double_definitions/double_definition.rb', line 5 def register_strategy_class(strategy_class, method_name) class_eval((<<-CLASS), __FILE__, __LINE__ + 1) def #{method_name}(subject=DoubleDefinitionCreator::NO_SUBJECT, method_name=nil, &definition_eval_block) ChildDoubleDefinitionCreator.new(self).#{method_name}(subject, method_name, &definition_eval_block) end CLASS class_eval((<<-CLASS), __FILE__, __LINE__ + 1) def #{method_name}!(method_name=nil, &definition_eval_block) ChildDoubleDefinitionCreator.new(self).#{method_name}!(method_name, &definition_eval_block) end CLASS end |
Instance Method Details
#root_subject ⇒ Object
46 47 48 |
# File 'lib/rr/double_definitions/double_definition.rb', line 46 def root_subject double_definition_creator.root_subject end |