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/transactions.rb,
lib/aws-record/record/dirty_tracking.rb,
lib/aws-record/record/key_attributes.rb,
lib/aws-record/record/item_collection.rb,
lib/aws-record/record/item_operations.rb,
lib/aws-record/record/table_migration.rb,
lib/aws-record/record/buildable_search.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/time_marshaler.rb,
lib/aws-record/record/marshalers/float_marshaler.rb,
lib/aws-record/record/marshalers/string_marshaler.rb,
lib/aws-record/record/marshalers/boolean_marshaler.rb,
lib/aws-record/record/marshalers/integer_marshaler.rb,
lib/aws-record/record/marshalers/date_time_marshaler.rb,
lib/aws-record/record/marshalers/epoch_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, Transactions Classes: Attribute, BuildableSearch, ItemCollection, ItemData, KeyAttributes, ModelAttributes, TableConfig, TableMigration

Constant Summary collapse

VERSION =
'2.4.0'

Class Method Summary collapse

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 Attributes::ClassMethods

attr, attributes, boolean_attr, date_attr, datetime_attr, epoch_time_attr, float_attr, hash_key, integer_attr, keys, list_attr, map_attr, numeric_set_attr, range_key, string_attr, string_set_attr, time_attr

Methods included from ItemOperations::ItemOperationsClassMethods

find, find_with_opts, tfind_opts, transact_check_expression, transact_find, update

Methods included from Query::QueryClassMethods

build_query, build_scan, query, scan

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 DirtyTracking

#attribute_dirty!, #attribute_dirty?, #attribute_was, #clean!, #destroyed?, #dirty, #dirty?, #new_record?, #persisted?, #reload!, #rollback!, #rollback_attribute!, #save

Methods included from ItemOperations

#assign_attributes, #delete!, #save, #save!, #update, #update!

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
# File 'lib/aws-record/record.rb', line 52

def self.included(sub_class)
  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