Class: Faker::Shorthand::Matcher
- Inherits:
-
Object
- Object
- Faker::Shorthand::Matcher
- Defined in:
- lib/faker/shorthand/matcher.rb
Instance Method Summary collapse
-
#initialize ⇒ Matcher
constructor
A new instance of Matcher.
- #method_missing(method, **args, &block) ⇒ Object
Constructor Details
#initialize ⇒ Matcher
Returns a new instance of Matcher.
4 5 6 7 |
# File 'lib/faker/shorthand/matcher.rb', line 4 def initialize @klass = nil @method = nil end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, **args, &block) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/faker/shorthand/matcher.rb', line 9 def method_missing(method, **args, &block) unless @klass catch_module_errors { define_faker_class(method) } self else catch_method_errors { send_faker_method(method, **args, &block) } end end |