Class: Tins::NullPlus
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ NullPlus
constructor
A new instance of NullPlus.
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