Class: AWS::DynamoDB::Resource

Inherits:
Core::Resource show all
Defined in:
lib/aws/dynamo_db/resource.rb

Direct Known Subclasses

Table

Instance Attribute Summary

Attributes included from Core::Model

#config

Class Method Summary collapse

Methods inherited from Core::Resource

attribute_providers, attribute_providers_for, attributes, #attributes_from_response, define_attribute_type, #eql?, #initialize, #inspect, new_from

Methods included from Core::Cacheable

included, #retrieve_attribute

Methods included from Core::Model

#client, #config_prefix, #initialize, #inspect

Constructor Details

This class inherits a constructor from AWS::Core::Resource

Class Method Details

.attribute(name, options = {}) ⇒ Object


19
20
21
22
23
24
25
26
27
28
29
# File 'lib/aws/dynamo_db/resource.rb', line 19

def self.attribute name, options = {}

  # DynamoDB attributes are all returned in UpperCamelCase, this
  # converts the :snake_case name into the correct format.
  unless options[:as]
    options[:as] = name.to_s.split(/_/).map(&:capitalize).join
  end

  super(name, options)

end