class DeviceCloud::Config

Constants

DEFAULT_HOST
DEFAULT_PASSWORD
DEFAULT_PROTOCOL
DEFAULT_USERNAME

Attributes

host[RW]
password[RW]
protocol[RW]
username[RW]

Public Class Methods

new(args) click to toggle source
# File lib/device_cloud/config.rb, line 10
def initialize(args)
  args = Hash[*args.map { |k, v| [k.to_s, v] }.flatten] unless args.nil?
  init_with args
end

Public Instance Methods

init_with(args) click to toggle source

YAML Initializer

# File lib/device_cloud/config.rb, line 16
def init_with(args)
  @username = args["username"] || DEFAULT_USERNAME
  @password = args["password"] || DEFAULT_PASSWORD
  @host = args["host"] || DEFAULT_HOST
  @protocol = args["protocol"] || DEFAULT_PROTOCOL
end