You are viewing documentation for version 1 of the AWS SDK for Ruby. Version 2 documentation can be found here.

Module: AWS::Record

Defined in:
lib/aws/record.rb,
lib/aws/record/model.rb,
lib/aws/record/scope.rb,
lib/aws/record/naming.rb,
lib/aws/record/errors.rb,
lib/aws/record/validator.rb,
lib/aws/record/attributes.rb,
lib/aws/record/exceptions.rb,
lib/aws/record/hash_model.rb,
lib/aws/record/conversion.rb,
lib/aws/record/validations.rb,
lib/aws/record/model/scope.rb,
lib/aws/record/abstract_base.rb,
lib/aws/record/dirty_tracking.rb,
lib/aws/record/validators/block.rb,
lib/aws/record/validators/count.rb,
lib/aws/record/hash_model/scope.rb,
lib/aws/record/model/attributes.rb,
lib/aws/record/validators/length.rb,
lib/aws/record/validators/format.rb,
lib/aws/record/validators/method.rb,
lib/aws/record/validators/presence.rb,
lib/aws/record/model/finder_methods.rb,
lib/aws/record/validators/exclusion.rb,
lib/aws/record/validators/inclusion.rb,
lib/aws/record/hash_model/attributes.rb,
lib/aws/record/validators/acceptance.rb,
lib/aws/record/validators/confirmation.rb,
lib/aws/record/validators/numericality.rb,
lib/aws/record/hash_model/finder_methods.rb

Overview

AWS::Record is an ORM built on top of AWS services.

Defined Under Namespace

Modules: AbstractBase, Attributes, DirtyTracking, Validations Classes: Errors, HashModel, Model, Scope

Constant Summary

Base =

for backwards compatability with the old AWS::Record::Base

Model

Class Method Summary collapse

Class Method Details

.domain_prefixString?

Returns The string that is prepended to all domain names.

Returns:

  • (String, nil)

    The string that is prepended to all domain names.



74
75
76
# File 'lib/aws/record.rb', line 74

def self.domain_prefix
  @domain_prefix
end

.domain_prefix=(prefix) ⇒ Object

Sets a prefix to be applied to all SimpleDB domains associated with AWS::Record::Base classes.

AWS::Record.domain_prefix = 'production_'

class Product < AWS::Record::Base
  set_shard_name 'products'
end

p = Product.new
p.shard #=> 'products'
p.save # the product is persisted to the 'production-products' domain

Parameters:

  • prefix (String)

    A prefix to append to all domains. This is useful for grouping domains used by one application with a single prefix.



69
70
71
# File 'lib/aws/record.rb', line 69

def self.domain_prefix= prefix
  @domain_prefix = prefix
end

.table_prefixString?

Returns The string that is prepended to all table names.

Returns:

  • (String, nil)

    The string that is prepended to all table names.



101
102
103
# File 'lib/aws/record.rb', line 101

def self.table_prefix
  @table_prefix
end

.table_prefix=(prefix) ⇒ Object

Sets a prefix to be applied to all DynamoDB tables associated with HashModel and ListModel classes.

AWS::Record.table_prefix = 'production_'

class Product < AWS::Record::HashModel
  set_shard_name 'products'
end

p = Product.new
p.shard #=> 'products'
p.save # the product is persisted to the 'production-products' table

Parameters:

  • prefix (String)

    A prefix to append to all tables. This is useful for grouping tables used by one application with a single prefix.



96
97
98
# File 'lib/aws/record.rb', line 96

def self.table_prefix= prefix
  @table_prefix = prefix
end