Class: Pwush::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/pwush/config.rb

Constant Summary collapse

URL =
'https://cp.pushwoosh.com/json/1.3'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Config

Returns a new instance of Config.



10
11
12
13
14
15
16
# File 'lib/pwush/config.rb', line 10

def initialize(options = {})
  @url     = options[:url]     || URL
  @auth    = options[:auth]    || auth_missing
  @app     = options[:app]     || app_missing
  @timeout = options[:timeout] || { write: 2, connect: 5, read: 10 }
  @logger  = options[:logger]  || Logger.new(STDOUT)
end

Instance Attribute Details

#appObject

Returns the value of attribute app.



18
19
20
# File 'lib/pwush/config.rb', line 18

def app
  @app
end

#authObject

Returns the value of attribute auth.



18
19
20
# File 'lib/pwush/config.rb', line 18

def auth
  @auth
end

#loggerObject

Returns the value of attribute logger.



18
19
20
# File 'lib/pwush/config.rb', line 18

def logger
  @logger
end

#timeoutObject

Returns the value of attribute timeout.



18
19
20
# File 'lib/pwush/config.rb', line 18

def timeout
  @timeout
end

#urlObject

Returns the value of attribute url.



18
19
20
# File 'lib/pwush/config.rb', line 18

def url
  @url
end