Class: Philiprehberger::DotAccess::NullAccess
- Inherits:
-
Object
- Object
- Philiprehberger::DotAccess::NullAccess
show all
- Defined in:
- lib/philiprehberger/dot_access.rb
Overview
Null object that responds to any method with nil
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(_name, *_args) ⇒ NullAccess
Returns self for chaining
89
90
91
|
# File 'lib/philiprehberger/dot_access.rb', line 89
def method_missing(_name, *_args)
self
end
|
Instance Method Details
#inspect ⇒ String
104
105
106
|
# File 'lib/philiprehberger/dot_access.rb', line 104
def inspect
'#<NullAccess>'
end
|
#nil? ⇒ true
99
100
101
|
# File 'lib/philiprehberger/dot_access.rb', line 99
def nil?
true
end
|
#respond_to_missing?(_name, _include_private = false) ⇒ true
94
95
96
|
# File 'lib/philiprehberger/dot_access.rb', line 94
def respond_to_missing?(_name, _include_private = false)
true
end
|
#to_s ⇒ String
109
110
111
|
# File 'lib/philiprehberger/dot_access.rb', line 109
def to_s
''
end
|