class Quickbase::Connection

Attributes

apptoken[W]
dbid[W]
hours[W]
http_proxy[W]
org[W]
password[W]
username[W]
usertoken[W]
apptoken[R]
dbid[R]
hours[R]
http_proxy[R]
org[R]
password[R]
username[R]
usertoken[R]

Public Class Methods

expectant_reader(*attributes) click to toggle source
   # File lib/classes/connection.rb
 8 def self.expectant_reader(*attributes)
 9   attributes.each do |attribute|
10     (class << self; self; end).send(:define_method, attribute) do
11       attribute_value = instance_variable_get("@#{attribute}")
12       attribute_value
13     end
14   end
15 end
new(options = {}) click to toggle source
   # File lib/classes/connection.rb
18 def initialize(options = {})
19   [:username, :password, :hours, :apptoken, :dbid, :org, :http_proxy, :usertoken].each do |attr|
20     instance_variable_set "@#{attr}", (options[attr].nil? ? Quickbase::Connection.send(attr) : options[attr])
21   end
22   instance_variable_set "@org", "www" if org.nil?
23 end

Public Instance Methods

api() click to toggle source
   # File lib/classes/connection.rb
42 def api
43   Quickbase::API.new(self)
44 end
http() click to toggle source
   # File lib/classes/connection.rb
38 def http
39   Quickbase::HTTP.new(instantiate)
40 end
instantiate() click to toggle source
   # File lib/classes/connection.rb
25 def instantiate
26   {
27     username: username,
28     password: password,
29     hours: hours,
30     apptoken: apptoken,
31     dbid: dbid,
32     org: org,
33     http_proxy: http_proxy,
34     usertoken: usertoken
35   }
36 end