Class: Marshal::BlackHole

Inherits:
Object show all
Defined in:
lib/utilrb/marshal/load_with_missing_constants.rb

Class Attribute Summary collapse

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ BlackHole

Returns a new instance of BlackHole


7
8
# File 'lib/utilrb/marshal/load_with_missing_constants.rb', line 7

def initialize(*args)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(*args) ⇒ Object


19
20
21
22
# File 'lib/utilrb/marshal/load_with_missing_constants.rb', line 19

def method_missing(*args)
    ::Kernel.puts args.inspect
    ::Kernel.puts ::Kernel.caller
end

Class Attribute Details

.nameObject (readonly)

Returns the value of attribute name


4
5
6
# File 'lib/utilrb/marshal/load_with_missing_constants.rb', line 4

def name
  @name
end

Instance Attribute Details

#__content__Object (readonly)

Returns the value of attribute __content__


18
19
20
# File 'lib/utilrb/marshal/load_with_missing_constants.rb', line 18

def __content__
  @__content__
end

Class Method Details

._load(*args) ⇒ Object


23
24
25
26
# File 'lib/utilrb/marshal/load_with_missing_constants.rb', line 23

def self._load(*args)
    hole = BlackHole.new
    hole.instance_variable_set(:@__content__, args)
end

.method_missing(*args, **options) ⇒ Object


28
29
30
# File 'lib/utilrb/marshal/load_with_missing_constants.rb', line 28

def self.method_missing(*args, **options)
    BlackHole.new
end

Instance Method Details

#eql?(obj) ⇒ Boolean

Returns:

  • (Boolean)

14
15
16
# File 'lib/utilrb/marshal/load_with_missing_constants.rb', line 14

def eql?(obj)
    equal?(obj)
end

#hashObject


10
11
12
# File 'lib/utilrb/marshal/load_with_missing_constants.rb', line 10

def hash
    __id__
end