lib/leadtune/config.rb in leadtune-0.0.8 vs lib/leadtune/config.rb in leadtune-0.0.9
- old
+ new
@@ -5,17 +5,17 @@
# Copyright 2010 LeadTune LLC
module Leadtune
class Config #:nodoc:all
+ attr_accessor :environment, :leadtune_host, :api_key, :timeout, :query_params
- attr_accessor :environment, :leadtune_host, :api_key, :timeout
-
@@leadtune_host = nil
@@api_key = nil
@@organization = nil
@@timeout = nil
+ @@query_params = nil
def self.api_key=(api_key)
@@api_key = api_key
end
@@ -29,18 +29,26 @@
def self.timeout=(timeout)
@@timeout = timeout
end
+ def self.query_params=(query_params)
+ @@query_params = query_params
+ end
+
def api_key
@api_key ||= @@api_key
end
def timeout
@timeout ||= @@timeout || DEFAULT_TIMEOUT
end
+ def query_params
+ @query_params ||= @@query_params
+ end
+
def organization
@@organization
end
def leadtune_host
@@ -53,10 +61,10 @@
def production_environment_detected?
if ENV.include?("APP_ENV")
"production" == ENV["APP_ENV"]
else
- defined?(Rails) && Rails.env.production? ||
+ defined?(Rails) && "production" == Rails.env ||
"production" == ENV["RACK_ENV"] ||
"production" == ENV["RAILS_ENV"] ||
defined?(RAILS_ENV) && "production" == RAILS_ENV
end
end