Class: Mblox::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/mblox/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



15
16
17
18
19
# File 'lib/mblox/configuration.rb', line 15

def initialize
  @logger = Rails.logger if defined?(::Rails)
  @log_level = :debug
  @on_message_too_long = :raise_error
end

Instance Attribute Details

#log_levelObject (readonly)

Returns the value of attribute log_level.



14
15
16
# File 'lib/mblox/configuration.rb', line 14

def log_level
  @log_level
end

#loggerObject

Returns the value of attribute logger.



14
15
16
# File 'lib/mblox/configuration.rb', line 14

def logger
  @logger
end

#on_message_too_longObject

Returns the value of attribute on_message_too_long.



14
15
16
# File 'lib/mblox/configuration.rb', line 14

def on_message_too_long
  @on_message_too_long
end

#outbound_urlObject

Returns the value of attribute outbound_url.



13
14
15
# File 'lib/mblox/configuration.rb', line 13

def outbound_url
  @outbound_url
end

#partner_nameObject

Returns the value of attribute partner_name.



13
14
15
# File 'lib/mblox/configuration.rb', line 13

def partner_name
  @partner_name
end

#passwordObject

Returns the value of attribute password.



13
14
15
# File 'lib/mblox/configuration.rb', line 13

def password
  @password
end

#profile_idObject

Returns the value of attribute profile_id.



13
14
15
# File 'lib/mblox/configuration.rb', line 13

def profile_id
  @profile_id
end

#sender_idObject

Returns the value of attribute sender_id.



13
14
15
# File 'lib/mblox/configuration.rb', line 13

def sender_id
  @sender_id
end

#service_idObject

Returns the value of attribute service_id.



13
14
15
# File 'lib/mblox/configuration.rb', line 13

def service_id
  @service_id
end

#tariffObject

Returns the value of attribute tariff.



13
14
15
# File 'lib/mblox/configuration.rb', line 13

def tariff
  @tariff
end

Instance Method Details

#log_at(level) ⇒ Object



26
27
28
29
# File 'lib/mblox/configuration.rb', line 26

def log_at level
  validate @logger, level
  @log_level = level
end