Module: Tins::Null
- Defined in:
- lib/tins/null.rb
Overview
Implementation of the null object pattern in Ruby.
Defined Under Namespace
Modules: Kernel
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing ⇒ Object
4
5
6
|
# File 'lib/tins/null.rb', line 4
def method_missing(*)
self
end
|
Instance Method Details
#const_missing ⇒ Object
8
9
10
|
# File 'lib/tins/null.rb', line 8
def const_missing(*)
self
end
|
16
17
18
|
# File 'lib/tins/null.rb', line 16
def inspect
'NULL'
end
|
#nil? ⇒ Boolean
20
21
22
|
# File 'lib/tins/null.rb', line 20
def nil?
true
end
|
12
13
14
|
# File 'lib/tins/null.rb', line 12
def to_s
''
end
|