Sha256: fab7ee5ad5f8fa894d415cc546d65c8c61d0e9bc1f82cde6196df7d16de49e00

Contents?: true

Size: 1.67 KB

Versions: 3

Compression:

Stored size: 1.67 KB

Contents

module Apphunk
  
  # Used to configure the behaviour of Apphunk and its outgoing messages. Each option can be overriden by Apphunk.post's +option+ parameter.
  # If Apphunk is used as part of a Rails application, the configuration should go to +config/initializers/apphunk.rb+.
  #
  # *Note*: The configuration must be set using Apphunk.config as shown in the example below.
  #
  # ==== Example
  #  Apphunk.config do |config|
  #    config.token = "secret_project_token"
  #  end
  #
  module Config
    class << self
      
      # The current environment. Automatically retrieved if Apphunk is running as part of a Rails app.
      #
      # ==== Example
      #  config.environment = 'production'
      #
      attr_accessor :environment
      
      # A list of allowed environments. Apphunk will only send messages if Apphunk::Config.environment is part of these allowed environments.
      # *Note*: This step is skipped if Apphunk::Config.environment is +empty+.
      #
      # ==== Example
      #  config.environments = %w(production staging)
      #
      attr_accessor :environments

      # A list of tags to be send with each message.
      #
      # ==== Example
      #  config.tags = 'each, message, will, get, these, tags'
      #      
      attr_accessor :tags

      # The token as provided by apphunk.com. Used to authenticate a message request.
      #
      # ==== Example
      #  config.token = 'secrect_project_token'
      #      
      attr_accessor :token

      # A list of trails to be send with each message.
      #
      # ==== Example
      #  config.trails = { :product => 'Car', :country => 'Germany' }
      #      
      attr_accessor :trails

    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
apphunk-0.5.1 lib/apphunk/config.rb
apphunk-0.5.0 lib/apphunk/config.rb
apphunk-0.4.1 lib/apphunk/config.rb