Class: CanvasDataClient::Client
Instance Attribute Summary collapse
Instance Method Summary
collapse
#download_latest_to_csv_file, #download_to_csv_file
#compute_signature, #headers
#rfc7231
Constructor Details
#initialize(key, secret, opts = {}) ⇒ Client
Returns a new instance of Client.
10
11
12
13
14
15
16
|
# File 'lib/canvas_data_client/client.rb', line 10
def initialize(key, secret, opts = {})
self.key = key
self.secret = secret
self.subdomain = opts[:subdomain] || 'portal'
self.account = opts[:account] || 'self'
self.logger = Logger.new(STDOUT)
end
|
Instance Attribute Details
#account ⇒ Object
Returns the value of attribute account.
8
9
10
|
# File 'lib/canvas_data_client/client.rb', line 8
def account
@account
end
|
#key ⇒ Object
Returns the value of attribute key.
8
9
10
|
# File 'lib/canvas_data_client/client.rb', line 8
def key
@key
end
|
#logger ⇒ Object
Returns the value of attribute logger.
8
9
10
|
# File 'lib/canvas_data_client/client.rb', line 8
def logger
@logger
end
|
#secret ⇒ Object
Returns the value of attribute secret.
8
9
10
|
# File 'lib/canvas_data_client/client.rb', line 8
def secret
@secret
end
|
#subdomain ⇒ Object
Returns the value of attribute subdomain.
8
9
10
|
# File 'lib/canvas_data_client/client.rb', line 8
def subdomain
@subdomain
end
|
Instance Method Details
#domain ⇒ Object
18
19
20
|
# File 'lib/canvas_data_client/client.rb', line 18
def domain
"https://#{subdomain}.inshosteddata.com"
end
|
#dump(dump_id) ⇒ Object
35
36
37
|
# File 'lib/canvas_data_client/client.rb', line 35
def dump(dump_id)
json_request "#{domain}/api/account/#{account}/file/byDump/#{dump_id}"
end
|
#dumps ⇒ Object
27
28
29
|
# File 'lib/canvas_data_client/client.rb', line 27
def dumps
paginated_request "#{domain}/api/account/#{account}/dump?after=%s"
end
|
#get_latest_dumps ⇒ Object
31
32
33
|
# File 'lib/canvas_data_client/client.rb', line 31
def get_latest_dumps
json_request "#{domain}/api/account/#{account}/dump"
end
|
#latest_files ⇒ Object
Also known as:
latest
22
23
24
|
# File 'lib/canvas_data_client/client.rb', line 22
def latest_files
json_request "#{domain}/api/account/#{account}/file/latest"
end
|
#latest_schema ⇒ Object
47
48
49
|
# File 'lib/canvas_data_client/client.rb', line 47
def latest_schema
json_request "#{domain}/api/schema/latest"
end
|
#schema(version) ⇒ Object
51
52
53
|
# File 'lib/canvas_data_client/client.rb', line 51
def schema(version)
json_request "#{domain}/api/schema/#{version}"
end
|
#schemas ⇒ Object
43
44
45
|
# File 'lib/canvas_data_client/client.rb', line 43
def schemas
json_request "#{domain}/api/schema"
end
|
#tables(table) ⇒ Object
39
40
41
|
# File 'lib/canvas_data_client/client.rb', line 39
def tables(table)
paginated_request "#{domain}/api/account/#{account}/file/byTable/#{table}?after=%s"
end
|