class UserApp::ClientOptions

Attributes

app_id[RW]
base_address[RW]
debug[RW]
logger[RW]
secure[RW]
throw_errors[RW]
token[RW]
version[RW]

Public Class Methods

get_global(*args) click to toggle source
# File lib/userapp/client_options.rb, line 47
def self.get_global(*args)
        if @@instance.nil?
                @@instance = ClientOptions.new(args)
        end
        return @@instance
end
new(*args) click to toggle source
# File lib/userapp/client_options.rb, line 16
def initialize(*args)
        @version = 1
        @base_address = 'api.userapp.io'
        @throw_errors = true
        @secure = true
        @debug = false

        if !args.nil?
                if args.length == 1 and args[0].class == Hash
                        args = args[0]
                end

                self.set(args)
        end
end

Public Instance Methods

set(args) click to toggle source
# File lib/userapp/client_options.rb, line 39
def set(args)
        args.each do | key, value |
                if key and self.respond_to?(key)
                        self.send("#{key}=", value)
                end
        end
end