Class: XporterOnDemand::Client
- Inherits:
-
Object
- Object
- XporterOnDemand::Client
- Defined in:
- lib/xporter_on_demand/client.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#available_scopes ⇒ Object
readonly
Returns the value of attribute available_scopes.
-
#estab ⇒ Object
readonly
Returns the value of attribute estab.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
-
#edubase_client ⇒ Object
This is not finished and probably won’t even work.
-
#initialize(token = nil, args = {}) ⇒ Client
constructor
A new instance of Client.
- #school_client ⇒ Object
Methods included from Utils
#assign_attributes, #configure_request, #create_result, #dont_raise_exception, #handle_exceptions, #parameterize, #unwrap
Methods included from API
#changed_rows, #db_status, #fetch, #get_endpoint, #query
Constructor Details
#initialize(token = nil, args = {}) ⇒ Client
Returns a new instance of Client.
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/xporter_on_demand/client.rb', line 13 def initialize(token = nil, args = {}) @token = token @args = args details = token_details @available_scopes = details["Scopes"] @estab = @args.delete(:estab) @estab ||= details["Estab"] args[:edubase] ? edubase_client : school_client end |
Instance Attribute Details
#available_scopes ⇒ Object (readonly)
Returns the value of attribute available_scopes.
11 12 13 |
# File 'lib/xporter_on_demand/client.rb', line 11 def available_scopes @available_scopes end |
#estab ⇒ Object (readonly)
Returns the value of attribute estab.
11 12 13 |
# File 'lib/xporter_on_demand/client.rb', line 11 def estab @estab end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
11 12 13 |
# File 'lib/xporter_on_demand/client.rb', line 11 def token @token end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
11 12 13 |
# File 'lib/xporter_on_demand/client.rb', line 11 def uri @uri end |
Instance Method Details
#edubase_client ⇒ Object
This is not finished and probably won’t even work.
34 35 36 |
# File 'lib/xporter_on_demand/client.rb', line 34 def edubase_client @uri = API_PATH + "RunQuery/?" end |
#school_client ⇒ Object
29 30 31 |
# File 'lib/xporter_on_demand/client.rb', line 29 def school_client @uri = API_PATH + "School/" + estab + "/" end |