module Fog::Attributes::ClassMethods

Public Instance Methods

_load(marshalled) click to toggle source
# File lib/fog/core/attributes.rb, line 5
def _load(marshalled)
  new(Marshal.load(marshalled))
end
aliases() click to toggle source
# File lib/fog/core/attributes.rb, line 9
def aliases
  @aliases ||= {}
end
associations() click to toggle source
# File lib/fog/core/attributes.rb, line 13
def associations
  @associations ||= {}
end
attribute(name, options = {}) click to toggle source
# File lib/fog/core/attributes.rb, line 25
def attribute(name, options = {})
  type = options.fetch(:type, 'default').to_s.capitalize
  Fog::Attributes::const_get(type).new(self, name, options)
end
attributes() click to toggle source
# File lib/fog/core/attributes.rb, line 17
def attributes
  @attributes ||= []
end
default_values() click to toggle source
# File lib/fog/core/attributes.rb, line 21
def default_values
  @default_values ||= {}
end
has_many(name, collection_name) click to toggle source
# File lib/fog/core/attributes.rb, line 34
def has_many(name, collection_name)
  Fog::Associations::ManyModels.new(self, name, collection_name)
end
has_many_identities(name, collection_name) click to toggle source
# File lib/fog/core/attributes.rb, line 42
def has_many_identities(name, collection_name)
  Fog::Associations::ManyIdentities.new(self, name, collection_name)
end
has_one(name, collection_name) click to toggle source
# File lib/fog/core/attributes.rb, line 30
def has_one(name, collection_name)
  Fog::Associations::OneModel.new(self, name, collection_name)
end
has_one_identity(name, collection_name) click to toggle source
# File lib/fog/core/attributes.rb, line 38
def has_one_identity(name, collection_name)
  Fog::Associations::OneIdentity.new(self, name, collection_name)
end
identity(name, options = {}) click to toggle source
# File lib/fog/core/attributes.rb, line 46
def identity(name, options = {})
  @identity = name
  self.attribute(name, options)
end
ignore_attributes(*args) click to toggle source
# File lib/fog/core/attributes.rb, line 51
def ignore_attributes(*args)
  @ignored_attributes = args.collect {|attr| attr.to_s }
end
ignored_attributes() click to toggle source
# File lib/fog/core/attributes.rb, line 55
def ignored_attributes
  @ignored_attributes ||= []
end