Class: RR::DoubleDefinitions::Strategies::Strategy
- Inherits:
-
Object
- Object
- RR::DoubleDefinitions::Strategies::Strategy
- Includes:
- Space::Reader
- Defined in:
- lib/rr/double_definitions/strategies/strategy.rb
Direct Known Subclasses
Implementation::ImplementationStrategy, RR::DoubleDefinitions::Strategies::Scope::ScopeStrategy, Verification::VerificationStrategy
Class Attribute Summary collapse
-
.domain_name ⇒ Object
readonly
Returns the value of attribute domain_name.
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#definition ⇒ Object
readonly
Returns the value of attribute definition.
-
#double_definition_creator ⇒ Object
readonly
Returns the value of attribute double_definition_creator.
-
#handler ⇒ Object
readonly
Returns the value of attribute handler.
-
#method_name ⇒ Object
readonly
Returns the value of attribute method_name.
Class Method Summary collapse
- .register(domain_name, *alias_method_names) ⇒ Object
- .register_self_at_double_definition_creator ⇒ Object
Instance Method Summary collapse
- #call(definition, method_name, args, handler) ⇒ Object
-
#initialize(double_definition_creator) ⇒ Strategy
constructor
A new instance of Strategy.
- #name ⇒ Object
- #verify_subject(subject) ⇒ Object
Methods included from Space::Reader
Constructor Details
#initialize(double_definition_creator) ⇒ Strategy
Returns a new instance of Strategy.
31 32 33 |
# File 'lib/rr/double_definitions/strategies/strategy.rb', line 31 def initialize(double_definition_creator) @double_definition_creator = double_definition_creator end |
Class Attribute Details
.domain_name ⇒ Object (readonly)
Returns the value of attribute domain_name.
6 7 8 |
# File 'lib/rr/double_definitions/strategies/strategy.rb', line 6 def domain_name @domain_name end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
28 29 30 |
# File 'lib/rr/double_definitions/strategies/strategy.rb', line 28 def args @args end |
#definition ⇒ Object (readonly)
Returns the value of attribute definition.
28 29 30 |
# File 'lib/rr/double_definitions/strategies/strategy.rb', line 28 def definition @definition end |
#double_definition_creator ⇒ Object (readonly)
Returns the value of attribute double_definition_creator.
28 29 30 |
# File 'lib/rr/double_definitions/strategies/strategy.rb', line 28 def double_definition_creator @double_definition_creator end |
#handler ⇒ Object (readonly)
Returns the value of attribute handler.
28 29 30 |
# File 'lib/rr/double_definitions/strategies/strategy.rb', line 28 def handler @handler end |
#method_name ⇒ Object (readonly)
Returns the value of attribute method_name.
28 29 30 |
# File 'lib/rr/double_definitions/strategies/strategy.rb', line 28 def method_name @method_name end |
Class Method Details
.register(domain_name, *alias_method_names) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/rr/double_definitions/strategies/strategy.rb', line 7 def register(domain_name, *alias_method_names) @domain_name = domain_name register_self_at_double_definition_creator(domain_name) DoubleDefinitionCreator.class_eval do alias_method_names.each do |alias_method_name| alias_method alias_method_name, domain_name end end RR::Adapters::RRMethods.register_strategy_class(self, domain_name) DoubleDefinition.register_strategy_class(self, domain_name) RR::Adapters::RRMethods.class_eval do alias_method_names.each do |alias_method_name| alias_method alias_method_name, domain_name end end end |
.register_self_at_double_definition_creator ⇒ Object
24 25 |
# File 'lib/rr/double_definitions/strategies/strategy.rb', line 24 def register_self_at_double_definition_creator end |
Instance Method Details
#call(definition, method_name, args, handler) ⇒ Object
35 36 37 38 |
# File 'lib/rr/double_definitions/strategies/strategy.rb', line 35 def call(definition, method_name, args, handler) @definition, @method_name, @args, @handler = definition, method_name, args, handler do_call end |
#name ⇒ Object
40 41 42 |
# File 'lib/rr/double_definitions/strategies/strategy.rb', line 40 def name self.class.domain_name end |
#verify_subject(subject) ⇒ Object
44 45 |
# File 'lib/rr/double_definitions/strategies/strategy.rb', line 44 def verify_subject(subject) end |