Class: FakeAWS::S3::Bucket

Inherits:
Object
  • Object
show all
Defined in:
lib/fake_aws/s3/bucket.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, options = {}) ⇒ Bucket

Returns a new instance of Bucket.



8
9
10
11
12
# File 'lib/fake_aws/s3/bucket.rb', line 8

def initialize(name, options = {})
  @name = name
  @location_constraint = options[:location_constraint]
  clear!
end

Instance Attribute Details

#location_constraintObject (readonly)

Returns the value of attribute location_constraint.



16
17
18
# File 'lib/fake_aws/s3/bucket.rb', line 16

def location_constraint
  @location_constraint
end

#nameObject (readonly)

Returns the value of attribute name.



14
15
16
# File 'lib/fake_aws/s3/bucket.rb', line 14

def name
  @name
end

#objectsObject (readonly)

Returns the value of attribute objects.



15
16
17
# File 'lib/fake_aws/s3/bucket.rb', line 15

def objects
  @objects
end

Instance Method Details

#clear!Object



26
27
28
# File 'lib/fake_aws/s3/bucket.rb', line 26

def clear!
  @objects = ObjectCollection.new(self)
end

#empty?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/fake_aws/s3/bucket.rb', line 22

def empty?
  objects.empty?
end

#exists?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/fake_aws/s3/bucket.rb', line 18

def exists?
  true
end