Sha256: 1de4304b021a48814879c4e44cd281421202054e8fc8ba8ecae27d5d66493b99

Contents?: true

Size: 559 Bytes

Versions: 31

Compression:

Stored size: 559 Bytes

Contents

# frozen_string_literal: true

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

31 entries across 31 versions & 1 rubygems

Version Path
torque-postgresql-3.4.1 lib/torque/postgresql/attributes/lazy.rb
torque-postgresql-2.4.5 lib/torque/postgresql/attributes/lazy.rb
torque-postgresql-3.4.0 lib/torque/postgresql/attributes/lazy.rb
torque-postgresql-3.3.3 lib/torque/postgresql/attributes/lazy.rb
torque-postgresql-2.4.4 lib/torque/postgresql/attributes/lazy.rb
torque-postgresql-3.3.2 lib/torque/postgresql/attributes/lazy.rb
torque-postgresql-2.4.3 lib/torque/postgresql/attributes/lazy.rb
torque-postgresql-3.3.1 lib/torque/postgresql/attributes/lazy.rb
torque-postgresql-3.3.0 lib/torque/postgresql/attributes/lazy.rb
torque-postgresql-3.2.2 lib/torque/postgresql/attributes/lazy.rb
torque-postgresql-2.4.2 lib/torque/postgresql/attributes/lazy.rb
torque-postgresql-2.4.1 lib/torque/postgresql/attributes/lazy.rb
torque-postgresql-3.2.1 lib/torque/postgresql/attributes/lazy.rb
torque-postgresql-2.4.0 lib/torque/postgresql/attributes/lazy.rb
torque-postgresql-3.2.0 lib/torque/postgresql/attributes/lazy.rb
torque-postgresql-3.1.0 lib/torque/postgresql/attributes/lazy.rb
torque-postgresql-2.3.0 lib/torque/postgresql/attributes/lazy.rb
torque-postgresql-3.0.1 lib/torque/postgresql/attributes/lazy.rb
torque-postgresql-2.2.4 lib/torque/postgresql/attributes/lazy.rb
torque-postgresql-3.0.0 lib/torque/postgresql/attributes/lazy.rb