Class: Stackify::Configuration
- Defined in:
- lib/stackify/utils/configuration.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#app_location ⇒ Object
Returns the value of attribute app_location.
-
#app_name ⇒ Object
Returns the value of attribute app_name.
-
#base_api_url ⇒ Object
Returns the value of attribute base_api_url.
-
#env ⇒ Object
Returns the value of attribute env.
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#flood_limit ⇒ Object
readonly
Returns the value of attribute flood_limit.
-
#log_level ⇒ Object
Returns the value of attribute log_level.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#mode ⇒ Object
Returns the value of attribute mode.
-
#proxy_host ⇒ Object
Returns the value of attribute proxy_host.
-
#proxy_pass ⇒ Object
Returns the value of attribute proxy_pass.
-
#proxy_port ⇒ Object
Returns the value of attribute proxy_port.
-
#proxy_user ⇒ Object
Returns the value of attribute proxy_user.
-
#queue_max_size ⇒ Object
readonly
Returns the value of attribute queue_max_size.
-
#send_interval ⇒ Object
readonly
Returns the value of attribute send_interval.
-
#with_proxy ⇒ Object
Returns the value of attribute with_proxy.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #is_valid? ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/stackify/utils/configuration.rb', line 10 def initialize @base_api_url = 'https://api.stackify.com' @errors = [] @api_key = '' @env = :production @flood_limit = 100 @queue_max_size = 1000 @send_interval = 60 @with_proxy = false @log_level = :info @mode = MODES[:both] @logger = if defined? Rails Logger.new(File.join(Rails.root, 'log', 'stackify.log')) else Logger.new('stackify.log') end end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
5 6 7 |
# File 'lib/stackify/utils/configuration.rb', line 5 def api_key @api_key end |
#app_location ⇒ Object
Returns the value of attribute app_location.
5 6 7 |
# File 'lib/stackify/utils/configuration.rb', line 5 def app_location @app_location end |
#app_name ⇒ Object
Returns the value of attribute app_name.
5 6 7 |
# File 'lib/stackify/utils/configuration.rb', line 5 def app_name @app_name end |
#base_api_url ⇒ Object
Returns the value of attribute base_api_url.
5 6 7 |
# File 'lib/stackify/utils/configuration.rb', line 5 def base_api_url @base_api_url end |
#env ⇒ Object
Returns the value of attribute env.
5 6 7 |
# File 'lib/stackify/utils/configuration.rb', line 5 def env @env end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
8 9 10 |
# File 'lib/stackify/utils/configuration.rb', line 8 def errors @errors end |
#flood_limit ⇒ Object (readonly)
Returns the value of attribute flood_limit.
8 9 10 |
# File 'lib/stackify/utils/configuration.rb', line 8 def flood_limit @flood_limit end |
#log_level ⇒ Object
Returns the value of attribute log_level.
5 6 7 |
# File 'lib/stackify/utils/configuration.rb', line 5 def log_level @log_level end |
#logger ⇒ Object
Returns the value of attribute logger.
5 6 7 |
# File 'lib/stackify/utils/configuration.rb', line 5 def logger @logger end |
#mode ⇒ Object
Returns the value of attribute mode.
5 6 7 |
# File 'lib/stackify/utils/configuration.rb', line 5 def mode @mode end |
#proxy_host ⇒ Object
Returns the value of attribute proxy_host.
5 6 7 |
# File 'lib/stackify/utils/configuration.rb', line 5 def proxy_host @proxy_host end |
#proxy_pass ⇒ Object
Returns the value of attribute proxy_pass.
5 6 7 |
# File 'lib/stackify/utils/configuration.rb', line 5 def proxy_pass @proxy_pass end |
#proxy_port ⇒ Object
Returns the value of attribute proxy_port.
5 6 7 |
# File 'lib/stackify/utils/configuration.rb', line 5 def proxy_port @proxy_port end |
#proxy_user ⇒ Object
Returns the value of attribute proxy_user.
5 6 7 |
# File 'lib/stackify/utils/configuration.rb', line 5 def proxy_user @proxy_user end |
#queue_max_size ⇒ Object (readonly)
Returns the value of attribute queue_max_size.
8 9 10 |
# File 'lib/stackify/utils/configuration.rb', line 8 def queue_max_size @queue_max_size end |
#send_interval ⇒ Object (readonly)
Returns the value of attribute send_interval.
8 9 10 |
# File 'lib/stackify/utils/configuration.rb', line 8 def send_interval @send_interval end |
#with_proxy ⇒ Object
Returns the value of attribute with_proxy.
5 6 7 |
# File 'lib/stackify/utils/configuration.rb', line 5 def with_proxy @with_proxy end |
Instance Method Details
#is_valid? ⇒ Boolean
28 29 30 31 32 |
# File 'lib/stackify/utils/configuration.rb', line 28 def is_valid? @errors = [] validate_mode if validate_config_types @errors.empty? end |