Sha256: 5fea684869f6ad796430ac21b5df2c65b4c0cb09bd56c9998158e27ea8b4c1e6

Contents?: true

Size: 535 Bytes

Versions: 15

Compression:

Stored size: 535 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'.freeze
        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

15 entries across 15 versions & 1 rubygems

Version Path
torque-postgresql-1.1.8 lib/torque/postgresql/attributes/lazy.rb
torque-postgresql-1.1.7 lib/torque/postgresql/attributes/lazy.rb
torque-postgresql-2.0.3 lib/torque/postgresql/attributes/lazy.rb
torque-postgresql-2.0.2 lib/torque/postgresql/attributes/lazy.rb
torque-postgresql-1.1.6 lib/torque/postgresql/attributes/lazy.rb
torque-postgresql-1.1.5 lib/torque/postgresql/attributes/lazy.rb
torque-postgresql-2.0.1 lib/torque/postgresql/attributes/lazy.rb
torque-postgresql-2.0.0 lib/torque/postgresql/attributes/lazy.rb
torque-postgresql-1.1.4 lib/torque/postgresql/attributes/lazy.rb
torque-postgresql-1.1.3 lib/torque/postgresql/attributes/lazy.rb
torque-postgresql-1.1.2 lib/torque/postgresql/attributes/lazy.rb
torque-postgresql-1.1.1 lib/torque/postgresql/attributes/lazy.rb
torque-postgresql-1.1.0 lib/torque/postgresql/attributes/lazy.rb
torque-postgresql-1.0.1 lib/torque/postgresql/attributes/lazy.rb
torque-postgresql-1.0.0 lib/torque/postgresql/attributes/lazy.rb