module DeviceCloud::Configuration

Attributes

alert_notification_handler[RW]

Proc that will be called for handling DeviceCloud::PushNotification::AlertNotification objects Proc will be called with the alert notification object

data_notification_handler[RW]

Proc that will be called for handling DeviceCloud::PushNotification::DataNotification objects Proc will be called with the data notification object

empty_alert_notification_handler[RW]

Proc that will be called for handling DeviceCloud::PushNotification::AlertNotification objects that do not contain file data (data too large - over 120KB) Proc will be called with the alert notification object

empty_data_notification_handler[RW]

Proc that will be called for handling DeviceCloud::PushNotification::DataNotification objects that do not contain file data (data too large - over 120KB) Proc will be called with the data notification object

empty_event_notification_handler[RW]

Proc that will be called for handling DeviceCloud::PushNotification::EventNotification objects that do not contain file data (data too large - over 120KB) Proc will be called with the event notification object

event_notification_handler[RW]

Proc that will be called for handling DeviceCloud::PushNotification::EventNotification objects Proc will be called with the event notification object

logger[W]

DeviceCloud defualt logger

password[W]

DeviceCloud account password

username[W]

DeviceCloud account username

Public Instance Methods

config() click to toggle source
# File lib/device_cloud/configuration.rb, line 61
def config
  {
    username: username,
    password: password,
    root_url: root_url,
    host: host,
    alert_notification_handler: @alert_notification_handler,
    empty_alert_notification_handler: @empty_alert_notification_handler,
    data_notification_handler: @data_notification_handler,
    empty_data_notification_handler: @empty_data_notification_handler,
    event_notification_handler: @event_notification_handler,
    empty_event_notification_handler: @empty_event_notification_handler,
    logger: logger
  }.freeze
end
configure() { |self| ... } click to toggle source

Yield self to be able to configure ActivityFeed with block-style configuration.

Example:

DeviceCloud.configure do |configuration|
  configuration.root_url = 'https://example.com'
end
# File lib/device_cloud/configuration.rb, line 56
def configure
  yield self
  config
end
host() click to toggle source

DeviceCloud url

@return the DeviceCloud host - 'my.idigi.com'

# File lib/device_cloud/configuration.rb, line 87
def host
  'my.idigi.com'
end
logger() click to toggle source

DeviceCloud logger

@return the DeviceCloud logger or set the default to stdout

# File lib/device_cloud/configuration.rb, line 110
def logger
  @logger ||= Logger.new(STDOUT)
end
password() click to toggle source

DeviceCloud password

@return the DeviceCloud password or raises an error

# File lib/device_cloud/configuration.rb, line 102
def password
  raise 'DeviceCloud password is blank' if @password.nil? || @password == ''
  @password
end
root_url() click to toggle source

DeviceCloud url

@return the DeviceCloud url - 'my.idigi.com'

# File lib/device_cloud/configuration.rb, line 80
def root_url
  'https://my.idigi.com'
end
username() click to toggle source

DeviceCloud username

@return the DeviceCloud username or raises an error

# File lib/device_cloud/configuration.rb, line 94
def username
  raise 'DeviceCloud username is blank' if @username.nil? || @password == ''
  @username
end