Class: ActiveValidation::Decorator
- Inherits:
- BasicObject
- Defined in:
- lib/active_validation/decorator.rb
Direct Known Subclasses
ActiveValidation::Decorators::ConsistentRegistry, ActiveValidation::Decorators::DisallowsDuplicatesRegistry
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(component) ⇒ Decorator
constructor
A new instance of Decorator.
-
#method_missing(name, *args, &block) ⇒ Object
rubocop:disable Style/MethodMissingSuper.
- #respond_to_missing?(name, include_private = false) ⇒ Boolean
- #send(symbol, *args, &block) ⇒ Object
Constructor Details
#initialize(component) ⇒ Decorator
7 8 9 |
# File 'lib/active_validation/decorator.rb', line 7 def initialize(component) @component = component end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
rubocop:disable Style/MethodMissingSuper
11 12 13 |
# File 'lib/active_validation/decorator.rb', line 11 def method_missing(name, *args, &block) # rubocop:disable Style/MethodMissingSuper @component.send(name, *args, &block) end |
Class Method Details
.const_missing(name) ⇒ Object
23 24 25 |
# File 'lib/active_validation/decorator.rb', line 23 def self.const_missing(name) ::Object.const_get(name) end |
Instance Method Details
#respond_to_missing?(name, include_private = false) ⇒ Boolean
15 16 17 |
# File 'lib/active_validation/decorator.rb', line 15 def respond_to_missing?(name, include_private = false) @component.respond_to?(name, true) || super end |
#send(symbol, *args, &block) ⇒ Object
19 20 21 |
# File 'lib/active_validation/decorator.rb', line 19 def send(symbol, *args, &block) __send__(symbol, *args, &block) end |