Class: DudePolicy::NilDudePolicy
- Inherits:
-
Object
- Object
- DudePolicy::NilDudePolicy
- Includes:
- Singleton
- Defined in:
- lib/dude_policy/nil_dude_policy.rb
Instance Method Summary collapse
- #inspect ⇒ Object
- #method_missing ⇒ Object
-
#respond_to? ⇒ Boolean
test frameworks like RSpec test first if method responds to before calling it as this is a NullObject delegator it responds to any method call.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing ⇒ Object
5 6 7 |
# File 'lib/dude_policy/nil_dude_policy.rb', line 5 def method_missing(*) false end |
Instance Method Details
#inspect ⇒ Object
15 16 17 |
# File 'lib/dude_policy/nil_dude_policy.rb', line 15 def inspect "<#DudePolicy##{object_id} on nil>" end |
#respond_to? ⇒ Boolean
test frameworks like RSpec test first if method responds to before calling it as this is a NullObject delegator it responds to any method call
11 12 13 |
# File 'lib/dude_policy/nil_dude_policy.rb', line 11 def respond_to?(*) true end |