Class: Quickbase::Connection
- Inherits:
-
Object
- Object
- Quickbase::Connection
- Defined in:
- lib/classes/connection.rb
Class Attribute Summary (collapse)
-
+ (Object) apptoken
writeonly
Sets the attribute apptoken.
-
+ (Object) dbid
writeonly
Sets the attribute dbid.
-
+ (Object) hours
writeonly
Sets the attribute hours.
-
+ (Object) org
writeonly
Sets the attribute org.
-
+ (Object) password
writeonly
Sets the attribute password.
-
+ (Object) username
writeonly
Sets the attribute username.
Instance Attribute Summary (collapse)
-
- (Object) apptoken
readonly
Returns the value of attribute apptoken.
-
- (Object) dbid
readonly
Returns the value of attribute dbid.
-
- (Object) hours
readonly
Returns the value of attribute hours.
-
- (Object) org
readonly
Returns the value of attribute org.
-
- (Object) password
readonly
Returns the value of attribute password.
-
- (Object) username
readonly
Returns the value of attribute username.
Class Method Summary (collapse)
Instance Method Summary (collapse)
- - (Object) api
- - (Object) http
-
- (Connection) initialize(options = {})
constructor
A new instance of Connection.
- - (Object) instantiate
Constructor Details
- (Connection) initialize(options = {})
A new instance of Connection
18 19 20 21 22 23 |
# File 'lib/classes/connection.rb', line 18 def initialize( = {}) [:username, :password, :hours, :apptoken, :dbid, :org].each do |attr| instance_variable_set "@#{attr}", ([attr].nil? ? Quickbase::Connection.send(attr) : [attr]) end instance_variable_set "@org", "www" if org.nil? end |
Class Attribute Details
+ (Object) apptoken=(value) (writeonly)
Sets the attribute apptoken
4 5 6 |
# File 'lib/classes/connection.rb', line 4 def apptoken=(value) @apptoken = value end |
+ (Object) dbid=(value) (writeonly)
Sets the attribute dbid
4 5 6 |
# File 'lib/classes/connection.rb', line 4 def dbid=(value) @dbid = value end |
+ (Object) hours=(value) (writeonly)
Sets the attribute hours
4 5 6 |
# File 'lib/classes/connection.rb', line 4 def hours=(value) @hours = value end |
+ (Object) org=(value) (writeonly)
Sets the attribute org
4 5 6 |
# File 'lib/classes/connection.rb', line 4 def org=(value) @org = value end |
+ (Object) password=(value) (writeonly)
Sets the attribute password
4 5 6 |
# File 'lib/classes/connection.rb', line 4 def password=(value) @password = value end |
+ (Object) username=(value) (writeonly)
Sets the attribute username
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 |