Sha256: da156c75083ccc5871ac8dc812405d9f3f352fd014296b697f78bc8707717a8d

Contents?: true

Size: 528 Bytes

Versions: 24

Compression:

Stored size: 528 Bytes

Contents

module Torque
  module PostgreSQL
    module Attributes
      class Lazy < BasicObject

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

        def ==(other)
          other.nil?
        end

        def nil?
          true
        end

        def inspect
          'nil'
        end

        def __class__
          Lazy
        end

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

      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
torque-postgresql-0.2.16 lib/torque/postgresql/attributes/lazy.rb
torque-postgresql-0.2.15 lib/torque/postgresql/attributes/lazy.rb
torque-postgresql-0.2.14 lib/torque/postgresql/attributes/lazy.rb
torque-postgresql-0.2.13 lib/torque/postgresql/attributes/lazy.rb
torque-postgresql-0.2.12 lib/torque/postgresql/attributes/lazy.rb
torque-postgresql-0.2.11 lib/torque/postgresql/attributes/lazy.rb
torque-postgresql-0.2.10 lib/torque/postgresql/attributes/lazy.rb
torque-postgresql-0.2.9 lib/torque/postgresql/attributes/lazy.rb
torque-postgresql-0.2.8 lib/torque/postgresql/attributes/lazy.rb
torque-postgresql-0.2.7 lib/torque/postgresql/attributes/lazy.rb
torque-postgresql-0.2.6 lib/torque/postgresql/attributes/lazy.rb
torque-postgresql-0.2.5 lib/torque/postgresql/attributes/lazy.rb
torque-postgresql-0.2.4 lib/torque/postgresql/attributes/lazy.rb
torque-postgresql-0.2.3 lib/torque/postgresql/attributes/lazy.rb
torque-postgresql-0.2.2 lib/torque/postgresql/attributes/lazy.rb
torque-postgresql-0.2.1 lib/torque/postgresql/attributes/lazy.rb
torque-postgresql-0.1.7 lib/torque/postgresql/attributes/lazy.rb
torque-postgresql-0.1.6 lib/torque/postgresql/attributes/lazy.rb
torque-postgresql-0.1.5 lib/torque/postgresql/attributes/lazy.rb
torque-postgresql-0.1.4 lib/torque/postgresql/attributes/lazy.rb