module Spruz
  # Implementation of the null object pattern in Ruby.
  module Null
    def method_missing(*)
      self
    end

    def to_s
      ''
    end

    def inspect
      'NULL'
    end
  end

  NULL = Class.new do
    include Spruz::Null
  end.new
end

module Spruz
  # Implementation of the null object pattern in Ruby.
  module Null
    def method_missing(*)
      self
    end

    def const_missing(*)
      self
    end

    def to_s
      ''
    end

    def inspect
      'NULL'
    end
  end

  NULL = Class.new do
    include Spruz::Null
  end.new
end

Use const_missing for Null pattern as well
Use const_missing for Null pattern as well
