Class: Quickbase::Connection
- Inherits:
-
Object
- Object
- Quickbase::Connection
- Defined in:
- lib/classes/connection.rb
Class Attribute Summary collapse
-
.apptoken ⇒ Object
writeonly
Sets the attribute apptoken.
-
.dbid ⇒ Object
writeonly
Sets the attribute dbid.
-
.hours ⇒ Object
writeonly
Sets the attribute hours.
-
.http_proxy ⇒ Object
writeonly
Sets the attribute http_proxy.
-
.org ⇒ Object
writeonly
Sets the attribute org.
-
.password ⇒ Object
writeonly
Sets the attribute password.
-
.username ⇒ Object
writeonly
Sets the attribute username.
Instance Attribute Summary collapse
-
#apptoken ⇒ Object
readonly
Returns the value of attribute apptoken.
-
#dbid ⇒ Object
readonly
Returns the value of attribute dbid.
-
#hours ⇒ Object
readonly
Returns the value of attribute hours.
-
#http_proxy ⇒ Object
readonly
Returns the value of attribute http_proxy.
-
#org ⇒ Object
readonly
Returns the value of attribute org.
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Class Method Summary collapse
Instance Method Summary collapse
- #api ⇒ Object
- #http ⇒ Object
-
#initialize(options = {}) ⇒ Connection
constructor
A new instance of Connection.
- #instantiate ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Connection
Returns 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, :http_proxy].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
.apptoken=(value) ⇒ Object (writeonly)
Sets the attribute apptoken
4 5 6 |
# File 'lib/classes/connection.rb', line 4 def apptoken=(value) @apptoken = value end |
.dbid=(value) ⇒ Object (writeonly)
Sets the attribute dbid
4 5 6 |
# File 'lib/classes/connection.rb', line 4 def dbid=(value) @dbid = value end |
.hours=(value) ⇒ Object (writeonly)
Sets the attribute hours
4 5 6 |
# File 'lib/classes/connection.rb', line 4 def hours=(value) @hours = value end |
.http_proxy=(value) ⇒ Object (writeonly)
Sets the attribute http_proxy
4 5 6 |
# File 'lib/classes/connection.rb', line 4 def http_proxy=(value) @http_proxy = value end |
.org=(value) ⇒ Object (writeonly)
Sets the attribute org
4 5 6 |
# File 'lib/classes/connection.rb', line 4 def org=(value) @org = value end |
.password=(value) ⇒ Object (writeonly)
Sets the attribute password
4 5 6 |
# File 'lib/classes/connection.rb', line 4 def password=(value) @password = value end |
.username=(value) ⇒ Object (writeonly)
Sets the attribute username
4 5 6 |
# File 'lib/classes/connection.rb', line 4 def username=(value) @username = value end |
Instance Attribute Details
#apptoken ⇒ Object (readonly)
Returns the value of attribute apptoken.
6 7 8 |
# File 'lib/classes/connection.rb', line 6 def apptoken @apptoken end |
#dbid ⇒ Object (readonly)
Returns the value of attribute dbid.
6 7 8 |
# File 'lib/classes/connection.rb', line 6 def dbid @dbid end |
#hours ⇒ Object (readonly)
Returns the value of attribute hours.
6 7 8 |
# File 'lib/classes/connection.rb', line 6 def hours @hours end |
#http_proxy ⇒ Object (readonly)
Returns the value of attribute http_proxy.
6 7 8 |
# File 'lib/classes/connection.rb', line 6 def http_proxy @http_proxy end |
#org ⇒ Object (readonly)
Returns the value of attribute org.
6 7 8 |
# File 'lib/classes/connection.rb', line 6 def org @org end |
#password ⇒ Object (readonly)
Returns the value of attribute password.
6 7 8 |
# File 'lib/classes/connection.rb', line 6 def password @password end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
6 7 8 |
# File 'lib/classes/connection.rb', line 6 def username @username end |
Class Method Details
.expectant_reader(*attributes) ⇒ Object
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
#api ⇒ Object
41 42 43 |
# File 'lib/classes/connection.rb', line 41 def api Quickbase::API.new(self) end |
#http ⇒ Object
37 38 39 |
# File 'lib/classes/connection.rb', line 37 def http Quickbase::HTTP.new(instantiate) end |
#instantiate ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/classes/connection.rb', line 25 def instantiate config = { :username => username, :password => password, :hours => hours, :apptoken => apptoken, :dbid => dbid, :org => org, :http_proxy => http_proxy } end |