Sha256: 2c379bfa73d98f646e579e87d0924833e9405c7ccb57aa02d136eabebbe314c6

Contents?: true

Size: 382 Bytes

Versions: 4

Compression:

Stored size: 382 Bytes

Contents

module Loquor
  module ResourceMock

    def attributes
      @attributes
    end

    def attributes=(attrs)
      @attributes = attrs
    end

    def sample
      self.new(attributes)
    end

    def find(id)
      self.new(attributes.merge(id: id))
    end

    def where(*args)
      [ find(1), find(2) ]
    end

    def create(attrs)
      self.new(attrs)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
loquor-0.5.1 lib/loquor/resource_mock.rb
loquor-0.5.0 lib/loquor/resource_mock.rb
loquor-0.4.0 lib/loquor/resource_mock.rb
loquor-0.3.0 lib/loquor/resource_mock.rb