Sha256: db88b38378a6f67e56a342774b8965cc128219cb98c20deaaa46b45f6a40798b

Contents?: true

Size: 287 Bytes

Versions: 1

Compression:

Stored size: 287 Bytes

Contents

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.1.0 lib/json-orm/chainable-query.rb