Class: Fog::Model

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

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Model

Returns a new instance of Model.



4
5
6
# File 'lib/fog/model.rb', line 4

def initialize(attributes = {})
  update_attributes(attributes)
end

Instance Method Details

#inspectObject



8
9
10
11
12
13
14
# File 'lib/fog/model.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 << ">"
end

#update_attributes(attributes = {}) ⇒ Object



16
17
18
19
20
21
# File 'lib/fog/model.rb', line 16

def update_attributes(attributes = {})
  for key, value in attributes
    send(:"#{key}=", value)
  end
  self
end