Class: Fog::Association

Inherits:
Collection show all
Defined in:
lib/fog/core/association.rb

Instance Attribute Summary

Attributes inherited from Collection

#service

Instance Method Summary collapse

Methods inherited from Collection

#clear, #create, #destroy, #inspect, model, #model, #new, #reload, #table, #to_json

Methods included from Fog::Attributes::ClassMethods

#_load, #aliases, #associations, #attribute, #attributes, #default_values, #has_many, #has_many_identities, #has_one, #has_one_identity, #identity, #ignore_attributes, #ignored_attributes, #masks

Methods included from Core::DeprecatedConnectionAccessors

#connection, #connection=, #prepare_service_value

Methods included from Fog::Attributes::InstanceMethods

#_dump, #all_associations, #all_associations_and_attributes, #all_attributes, #associations, #attributes, #dup, #identity, #identity=, #identity_name, #masks, #merge_attributes, #new_record?, #persisted?, #requires, #requires_one

Constructor Details

#initialize(associations = []) ⇒ Association

Returns a new instance of Association.



3
4
5
6
# File 'lib/fog/core/association.rb', line 3

def initialize(associations = [])
  @loaded = true
  load(associations)
end

Instance Method Details

#load(associations) ⇒ Object



8
9
10
11
12
13
# File 'lib/fog/core/association.rb', line 8

def load(associations)
  return unless associations.kind_of?(Array)
  associations.each do |association|
    self << association
  end
end