Sha256: 3befa9c6c88b1e990fddfcded1d88d6c4fd87a42770bd6818d074aac0060b377

Contents?: true

Size: 319 Bytes

Versions: 1

Compression:

Stored size: 319 Bytes

Contents

# frozen_string_literal: true

module JSONORM
  class ChainableQuery
    def initialize(orm, data)
      @orm = orm
      @data = data
    end

    def where(attribute, value)
      @data = @data.select { |record| record[attribute].to_s == value.to_s }
      self
    end

    def execute
      @data
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
json-orm-0.2.1 lib/json-orm/chainable-query.rb