Module: Spruz::Null

Defined in:
lib/spruz/null.rb

Overview

Implementation of the null object pattern in Ruby.

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/spruz/null.rb', line 4

def method_missing(*)
  self
end

Instance Method Details

#const_missing ⇒ Object



8
9
10
# File 'lib/spruz/null.rb', line 8

def const_missing(*)
  self
end

#inspect ⇒ Object



16
17
18
# File 'lib/spruz/null.rb', line 16

def inspect
  'NULL'
end

#to_s ⇒ Object



12
13
14
# File 'lib/spruz/null.rb', line 12

def to_s
  ''
end