Sha256: a3818240bdedd524fa259cd02f75e63f9ae117792e13f7da4c28e5cf26e1ca37

Contents?: true

Size: 471 Bytes

Versions: 8

Compression:

Stored size: 471 Bytes

Contents

require 'forwardable'

module FakeSQS
  class CollectionView
    include Enumerable
    extend Forwardable
    def_delegators :@original, :[], :each, :empty?, :size, :length

    UnmodifiableObjectError = Class.new(StandardError)

    def initialize( original )
      @original = original
    end

    def []=(key_or_index,value)
      raise UnmodifiableObjectError.new("This is a collection view and can not be modified - #{key_or_index} => #{value}")
    end

  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
fake_sqs-0.4.3 lib/fake_sqs/collection_view.rb
fake_sqs-0.4.2 lib/fake_sqs/collection_view.rb
fake_sqs-0.4.1 lib/fake_sqs/collection_view.rb
fake_sqs-0.4.0 lib/fake_sqs/collection_view.rb
fake_sqs-0.3.1 lib/fake_sqs/collection_view.rb
fake_sqs-0.3.0 lib/fake_sqs/collection_view.rb
fake_sqs-0.2.0 lib/fake_sqs/collection_view.rb
fake_sqs-0.1.0 lib/fake_sqs/collection_view.rb