Class: Fog::Model
- Inherits:
-
Object
- Object
- Fog::Model
- Defined in:
- lib/fog/model.rb
Direct Known Subclasses
AWS::EC2::Address, AWS::EC2::KeyPair, AWS::S3::Bucket, AWS::S3::Object, AWS::S3::Owner
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Model
constructor
A new instance of Model.
- #inspect ⇒ Object
- #update_attributes(attributes = {}) ⇒ Object
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
#inspect ⇒ Object
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 |