Class: Tins::NullPlus

Inherits:
Object show all
Includes:
Null
Defined in:
lib/tins/null.rb

Instance Method Summary collapse

Methods included from Null

#as_json, #blank?, #const_missing, #inspect, #method_missing, #nil?, #to_a, #to_ary, #to_f, #to_i, #to_int, #to_json, #to_s, #to_str

Constructor Details

#initialize(opts = {}) ⇒ NullPlus

Returns a new instance of NullPlus.



91
92
93
94
95
96
97
# File 'lib/tins/null.rb', line 91

def initialize(opts = {})
  singleton_class.class_eval do
    opts.each do |name, value|
      define_method(name) { value }
    end
  end
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Tins::Null