Class: Torque::PostgreSQL::Attributes::Lazy

Inherits:
BasicObject
Defined in:
lib/torque/postgresql/attributes/lazy.rb

Instance Method Summary collapse

Constructor Details

#initialize(klass, *values) ⇒ Lazy

Returns a new instance of Lazy.



6
7
8
# File 'lib/torque/postgresql/attributes/lazy.rb', line 6

def initialize(klass, *values)
  @klass, @values = klass, values
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object



26
27
28
# File 'lib/torque/postgresql/attributes/lazy.rb', line 26

def method_missing(name, *args, &block)
  @klass.new(*@values).send(name, *args, &block)
end

Instance Method Details

#==(other) ⇒ Object



10
11
12
# File 'lib/torque/postgresql/attributes/lazy.rb', line 10

def ==(other)
  other.nil?
end

#__class__Object



22
23
24
# File 'lib/torque/postgresql/attributes/lazy.rb', line 22

def __class__
  Lazy
end

#inspectObject



18
19
20
# File 'lib/torque/postgresql/attributes/lazy.rb', line 18

def inspect
  'nil'.freeze
end

#nil?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/torque/postgresql/attributes/lazy.rb', line 14

def nil?
  true
end