Sha256: d0fffa292f142483cf29656d302883c6f6226c737e9e9862132f528da55533bf
Contents?: true
Size: 508 Bytes
Versions: 24
Compression:
Stored size: 508 Bytes
Contents
class DatasetFake attr_accessor :where, :insert, :inserts, :update, :updates, :first def initialize(opts = {}) opts.each { |k,v| send("#{k}=", v) } @inserts ||= [] @updates ||= [] end def where(conditions) @where.detect { |k,v| k == conditions }.last end def insert(attributes) inserts << attributes @insert end def update(attributes) updates << attributes @update end def first(conditions) @first.detect { |k,v| k == conditions }.last end end
Version data entries
24 entries across 24 versions & 7 rubygems