Class: DudePolicy::NilDudePolicy

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/dude_policy/nil_dude_policy.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missingObject



5
6
7
# File 'lib/dude_policy/nil_dude_policy.rb', line 5

def method_missing(*)
  false
end

Instance Method Details

#inspectObject



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

Returns:

  • (Boolean)


11
12
13
# File 'lib/dude_policy/nil_dude_policy.rb', line 11

def respond_to?(*)
  true
end