Class: Tins::NullPlus

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

Instance Method Summary collapse

Methods included from Null

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

Constructor Details

#initialize(opts = {}) ⇒ NullPlus

Returns a new instance of NullPlus.



82
83
84
85
86
87
88
# File 'lib/tins/null.rb', line 82

def initialize(opts = {})
  class << self; self; end.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