Class: Fog::Collection
- Inherits:
-
Object
- Object
- Fog::Collection
- Defined in:
- lib/fog/collection.rb
Direct Known Subclasses
AWS::EC2::Addresses, AWS::EC2::KeyPairs, AWS::EC2::Volumes, AWS::S3::Buckets, AWS::S3::Objects
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Collection
constructor
A new instance of Collection.
- #inspect ⇒ Object
- #update_attributes(attributes = {}) ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ Collection
Returns a new instance of Collection.
4 5 6 |
# File 'lib/fog/collection.rb', line 4 def initialize(attributes = {}) update_attributes(attributes) end |
Instance Method Details
#inspect ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/fog/collection.rb', line 8 def inspect data = "#<#{self.class.name}" for attribute in (self.instance_variables - ['@connection']) data << " #{attribute}=#{send(attribute[1..-1].to_sym).inspect}" end data << "[" self.each do |element| data << "#{element.inspect}, " end data = data[0..-3] data << "]>" end |
#update_attributes(attributes = {}) ⇒ Object
21 22 23 24 25 |
# File 'lib/fog/collection.rb', line 21 def update_attributes(attributes = {}) for key, value in attributes send(:"#{key}=", value) end end |