Sha256: 47e4aede9f1cf4c65a41a4def1530112fb0a3e3963de427390ab7153aa65d695

Contents?: true

Size: 450 Bytes

Versions: 1

Compression:

Stored size: 450 Bytes

Contents

class QueryableAssociationProxy
  def initialize(database_enum, loader)
    @database_enum = database_enum
    @loader = loader
  end

  attr_reader :database_enum, :loader
  private     :database_enum, :loader

  extend Forwardable
  def_delegators :database_enum, :where

  def where(criteria)
    @database_enum = database_enum.where(criteria)
    self
  end

  def each(&block)
    database_enum
      .map(&loader)
      .each(&block)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sequel_mapper-0.0.1 lib/sequel_mapper/queryable_association_proxy.rb