Class: Quickbase::Connection

Inherits:
Object
  • Object
show all
Defined in:
lib/classes/connection.rb

Class Attribute Summary (collapse)

Instance Attribute Summary (collapse)

Class Method Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Connection) initialize(options = {})

Returns a new instance of Connection



18
19
20
21
22
23
# File 'lib/classes/connection.rb', line 18

def initialize(options = {})
  [:username, :password, :hours, :apptoken, :dbid, :org].each do |attr|
    instance_variable_set "@#{attr}", (options[attr].nil? ? Quickbase::Connection.send(attr) : options[attr])
  end
  instance_variable_set "@org", "www" if org.nil?
end

Class Attribute Details

+ (Object) apptoken=(value) (writeonly)

Sets the attribute apptoken

Parameters:

  • value

    the value to set the attribute apptoken to.



4
5
6
# File 'lib/classes/connection.rb', line 4

def apptoken=(value)
  @apptoken = value
end

+ (Object) dbid=(value) (writeonly)

Sets the attribute dbid

Parameters:

  • value

    the value to set the attribute dbid to.



4
5
6
# File 'lib/classes/connection.rb', line 4

def dbid=(value)
  @dbid = value
end

+ (Object) hours=(value) (writeonly)

Sets the attribute hours

Parameters:

  • value

    the value to set the attribute hours to.



4
5
6
# File 'lib/classes/connection.rb', line 4

def hours=(value)
  @hours = value
end

+ (Object) org=(value) (writeonly)

Sets the attribute org

Parameters:

  • value

    the value to set the attribute org to.



4
5
6
# File 'lib/classes/connection.rb', line 4

def org=(value)
  @org = value
end

+ (Object) password=(value) (writeonly)

Sets the attribute password

Parameters:

  • value

    the value to set the attribute password to.



4
5
6
# File 'lib/classes/connection.rb', line 4

def password=(value)
  @password = value
end

+ (Object) username=(value) (writeonly)

Sets the attribute username

Parameters:

  • value

    the value to set the attribute username to.



4
5
6
# File 'lib/classes/connection.rb', line 4

def username=(value)
  @username = value
end

Instance Attribute Details

- (Object) apptoken (readonly)

Returns the value of attribute apptoken



6
7
8
# File 'lib/classes/connection.rb', line 6

def apptoken
  @apptoken
end

- (Object) dbid (readonly)

Returns the value of attribute dbid



6
7
8
# File 'lib/classes/connection.rb', line 6

def dbid
  @dbid
end

- (Object) hours (readonly)

Returns the value of attribute hours



6
7
8
# File 'lib/classes/connection.rb', line 6

def hours
  @hours
end

- (Object) org (readonly)

Returns the value of attribute org



6
7
8
# File 'lib/classes/connection.rb', line 6

def org
  @org
end

- (Object) password (readonly)

Returns the value of attribute password



6
7
8
# File 'lib/classes/connection.rb', line 6

def password
  @password
end

- (Object) username (readonly)

Returns the value of attribute username



6
7
8
# File 'lib/classes/connection.rb', line 6

def username
  @username
end

Class Method Details

+ (Object) expectant_reader(*attributes)



8
9
10
11
12
13
14
15
# File 'lib/classes/connection.rb', line 8

def self.expectant_reader(*attributes)
  attributes.each do |attribute|
    (class << self; self; end).send(:define_method, attribute) do
      attribute_value = instance_variable_get("@#{attribute}")
      attribute_value
    end
  end
end

Instance Method Details

- (Object) api



40
41
42
# File 'lib/classes/connection.rb', line 40

def api
  Quickbase::Api.new(self)
end

- (Object) http



36
37
38
# File 'lib/classes/connection.rb', line 36

def http
  Quickbase::Http.new(instantiate)
end

- (Object) instantiate



25
26
27
28
29
30
31
32
33
34
# File 'lib/classes/connection.rb', line 25

def instantiate
  config = {
    :username => username,
    :password => password,
    :hours => hours,
    :apptoken => apptoken,
    :dbid => dbid,
    :org => org
  }
end