Module: Mara

Defined in:
lib/mara.rb,
lib/mara/batch.rb,
lib/mara/error.rb,
lib/mara/model.rb,
lib/mara/query.rb,
lib/mara/table.rb,
lib/mara/client.rb,
lib/mara/version.rb,
lib/mara/configure.rb,
lib/mara/model/dsl.rb,
lib/mara/instrument.rb,
lib/mara/model/base.rb,
lib/mara/null_value.rb,
lib/mara/model/query.rb,
lib/mara/persistence.rb,
lib/mara/primary_key.rb,
lib/mara/dynamo_helpers.rb,
lib/mara/model/attributes.rb,
lib/mara/model/persistence.rb,
lib/mara/attribute_formatter.rb

Overview

Mara is a wrapper around DynamoDB that adds a model layer and a bunch of convenience functions.

Defined Under Namespace

Modules: DynamoHelpers, Model Classes: AttributeFormatter, Batch, Client, Configure, Error, NullValue, Persistence, PrimaryKey, Query, Rollback, Table

Constant Summary collapse

VERSION =

The current version of Mara

'0.1.0'.freeze
NULL =

Default NULL value

NullValue.new.freeze

Class Method Summary collapse

Class Method Details

.configObject

The current config



26
27
28
29
# File 'lib/mara/configure.rb', line 26

def self.config
  @config ||= Configure.new
  @config
end

.configure(env) {|config| ... } ⇒ void

This method returns an undefined value.

Configure Mara

Parameters:

  • env (String)

    The default environment that is being configured.

    If this block is called a second time, the previous env version will be overridden

Yields:

  • (config)

    The configuration object to set values on.

Yield Parameters:

Yield Returns:

  • (void)


16
17
18
19
20
# File 'lib/mara/configure.rb', line 16

def self.configure(env)
  instance = config
  instance.send(:_set_env, env)
  yield(instance)
end

.instrument(name, *args, &block) ⇒ Object

Convenience method for ActiveSupport::Notifications that also namespaces

the key.

Parameters:

  • name (string)

    The name of the action being instrumented.

Returns:

  • (Object)

    The return value of the block



13
14
15
# File 'lib/mara/instrument.rb', line 13

def self.instrument(name, *args, &block)
  ActiveSupport::Notifications.instrument("mara.#{name}", *args, &block)
end