Module: ActivePStore::DynamicMatchers
- Included in:
- Base
- Defined in:
- lib/active_pstore/dynamic_matchers.rb
Defined Under Namespace
Classes: FindBy, FindByBang, Method
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *arguments, &block) ⇒ Object
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/active_pstore/dynamic_matchers.rb', line 19
def method_missing(name, *arguments, &block)
match = Method.match(self, name)
if match
match.define
send(name, *arguments, &block)
else
super
end
end
|
Instance Method Details
#respond_to?(name, include_private = false) ⇒ Boolean
8
9
10
11
12
13
14
15
|
# File 'lib/active_pstore/dynamic_matchers.rb', line 8
def respond_to?(name, include_private = false)
if self == Base
super
else
match = Method.match(self, name)
match || super
end
end
|