Module: Faker::FakerMethodsDelegator::ClassDelegationMethods
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args, &block) ⇒ Object
45
46
47
48
49
50
51
|
# File 'lib/fake.rb', line 45
def method_missing(method_name, *args, &block)
if (method = @faker_methods_hash[method_name])
method.call(*args, &block)
else
super
end
end
|
Instance Method Details
#faker_methods ⇒ Object
53
54
55
|
# File 'lib/fake.rb', line 53
def faker_methods
@faker_methods_hash.keys
end
|
#respond_to_with_faker_methods?(method_name, include_all = false) ⇒ Boolean
37
38
39
40
41
42
43
|
# File 'lib/fake.rb', line 37
def respond_to_with_faker_methods?(method_name, include_all=false)
if @faker_methods_hash[method_name]
true
else
respond_to_without_faker_methods?(method_name, include_all)
end
end
|