Sha256: 719512e603d0ab6b1cc5ca0763244ee2f7b169c78d8754cccfef7707b8b90f07

Contents?: true

Size: 959 Bytes

Versions: 1

Compression:

Stored size: 959 Bytes

Contents

require 'orm_adapter/adapters/mongoid'

module TokenAction
  # A token to authenticate an action.
  class Token
    include Mongoid::Document
    include Mongoid::Timestamps

    include TokenAction::Model

    # A shared secret.
    # @return [String] a token
    field :token, :type => String

    # The class on which to perform the action.
    # @return [String] a class name
    # @note `class` clashes with `Object#class` and Mongoid reserves `klass`.
    field :kind, :type => String

    # Any additional arguments for the action.
    # @return [Array] a list of arguments
    field :args, :type => Array

    # The URL to redirect to after performing the action successfully.
    # @return [String] a URL or path
    field :success_url, :type => String

    # The URL to redirect to after failing to perform the action.
    # @return [String] a URL or path
    field :failure_url, :type => String

    index({:token => 1}, :unique => true)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
token_action-0.0.1 lib/token_action/orm/mongoid.rb