module OData::Model::Attributes

The OData::Model::Attributes module encapsulates all the functionality specifically needed for OData::Model to support the mapping of OData::Entity properties to attributes on the class that includes OData::Model.

Public Instance Methods

attributes() click to toggle source

Returns an array of registered attributes. @return [Array] @api private

# File lib/odata/model/attributes.rb, line 28
def attributes
  self.class.class_variable_get(:@@attributes)
end
property_map() click to toggle source

Returns the hash for the attribute to property mapping. @return [Hash] @api private

# File lib/odata/model/attributes.rb, line 35
def property_map
  self.class.class_variable_get(:@@property_map)
end
update_attributes(attribute_hash) click to toggle source

Updates all the attributes on a model instance based on the passed in Hash. @params [Hash] hash of attributes to update @return [self]

# File lib/odata/model/attributes.rb, line 18
def update_attributes(attribute_hash)
  attribute_hash.each do |key, value|
    self.send(:"#{key}=", value) if self.respond_to?(:"#{key}=")
  end
  self
end