Class: Naught::NullClassBuilder::Commands::DefineImplicitConversions

Inherits:
Naught::NullClassBuilder::Command show all
Defined in:
lib/naught/null_class_builder/commands/define_implicit_conversions.rb

Instance Attribute Summary

Attributes inherited from Naught::NullClassBuilder::Command

#builder

Instance Method Summary collapse

Methods inherited from Naught::NullClassBuilder::Command

#defer, #initialize

Constructor Details

This class inherits a constructor from Naught::NullClassBuilder::Command

Instance Method Details

#callObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/naught/null_class_builder/commands/define_implicit_conversions.rb', line 7

def call
  defer do |subject|
    subject.module_eval do
      def to_ary
        []
      end

      def to_hash
        {}
      end

      def to_int
        0
      end

      def to_str
        ''
      end
    end
  end
end