Module: Aws::Record

Extended by:
Attributes::ClassMethods, DirtyTracking::DirtyTrackingClassMethods, ItemOperations::ItemOperationsClassMethods, Query::QueryClassMethods, RecordClassMethods, SecondaryIndexes::SecondaryIndexesClassMethods
Includes:
Attributes, DirtyTracking, ItemOperations, Query, SecondaryIndexes
Defined in:
lib/aws-record/record.rb,
lib/aws-record.rb,
lib/aws-record/record/query.rb,
lib/aws-record/record/errors.rb,
lib/aws-record/record/version.rb,
lib/aws-record/record/attribute.rb,
lib/aws-record/record/item_data.rb,
lib/aws-record/record/attributes.rb,
lib/aws-record/record/table_config.rb,
lib/aws-record/record/key_attributes.rb,
lib/aws-record/record/dirty_tracking.rb,
lib/aws-record/record/item_operations.rb,
lib/aws-record/record/item_collection.rb,
lib/aws-record/record/table_migration.rb,
lib/aws-record/record/model_attributes.rb,
lib/aws-record/record/secondary_indexes.rb,
lib/aws-record/record/marshalers/map_marshaler.rb,
lib/aws-record/record/marshalers/date_marshaler.rb,
lib/aws-record/record/marshalers/list_marshaler.rb,
lib/aws-record/record/marshalers/float_marshaler.rb,
lib/aws-record/record/marshalers/string_marshaler.rb,
lib/aws-record/record/marshalers/integer_marshaler.rb,
lib/aws-record/record/marshalers/boolean_marshaler.rb,
lib/aws-record/record/marshalers/date_time_marshaler.rb,
lib/aws-record/record/marshalers/string_set_marshaler.rb,
lib/aws-record/record/marshalers/numeric_set_marshaler.rb

Overview

Aws::Record is the module you include in your model classes in order to decorate them with the Amazon DynamoDB integration methods provided by this library. Methods you can use are shown below, in sub-modules organized by functionality.

Examples:

A class definition using Aws::Record

class MyModel
  include Aws::Record
  string_attr     :uuid,    hash_key: true
  integer_attr    :post_id, range_key: true
  boolean_attr    :is_active
  datetime_attr   :created_at
  string_set_attr :tags
  map_attr        :metadata
end

Defined Under Namespace

Modules: Attributes, DefaultMarshaler, DirtyTracking, Errors, ItemOperations, Marshalers, Query, RecordClassMethods, SecondaryIndexes Classes: Attribute, ItemCollection, TableConfig, TableMigration

Constant Summary

VERSION =
'1.1.1'

Class Method Summary collapse

Methods included from SecondaryIndexes::SecondaryIndexesClassMethods

global_secondary_index, global_secondary_indexes, global_secondary_indexes_for_migration, local_secondary_index, local_secondary_indexes, local_secondary_indexes_for_migration

Methods included from Query::QueryClassMethods

query, scan

Methods included from ItemOperations::ItemOperationsClassMethods

find, find_with_opts, update

Methods included from Attributes::ClassMethods

attr, boolean_attr, date_attr, datetime_attr, float_attr, hash_key, integer_attr, list_attr, map_attr, numeric_set_attr, range_key, string_attr, string_set_attr

Methods included from RecordClassMethods

configure_client, disable_mutation_tracking, enable_mutation_tracking, model_valid?, mutation_tracking_enabled?, provisioned_throughput, set_table_name, table_exists?, table_name

Methods included from DirtyTracking

#attribute_dirty!, #attribute_dirty?, #attribute_was, #dirty, #dirty?, #reload!, #rollback!, #rollback_attribute!, #save

Methods included from ItemOperations

#delete!, #save, #save!

Methods included from Attributes

#initialize, #to_h

Class Method Details

.included(sub_class) ⇒ Object

Usage of Aws::Record requires only that you include this module. This method will then pull in the other default modules.

Examples:

class MyTable
  include Aws::Record
  # Attribute definitions go here...
end


52
53
54
55
56
57
58
59
60
# File 'lib/aws-record/record.rb', line 52

def self.included(sub_class)
  @track_mutations = true
  sub_class.send(:extend, RecordClassMethods)
  sub_class.send(:include, Attributes)
  sub_class.send(:include, ItemOperations)
  sub_class.send(:include, DirtyTracking)
  sub_class.send(:include, Query)
  sub_class.send(:include, SecondaryIndexes)
end