Class: Fog::Collection

Inherits:
Object
  • Object
show all
Defined in:
lib/fog/collection.rb

Instance Method Summary collapse

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

#inspectObject



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