Class: Teamweek::Api::Client
- Inherits:
-
Object
- Object
- Teamweek::Api::Client
- Includes:
- Importer
- Defined in:
- lib/teamweek/api/client.rb
Instance Attribute Summary collapse
-
#base_uri ⇒ Object
Returns the value of attribute base_uri.
-
#client ⇒ Object
Returns the value of attribute client.
Instance Method Summary collapse
-
#import_projects(data) ⇒ Teamweek::Api::Project
Posts projects to Teamweek bulk_import url.
-
#import_tasks(data) ⇒ Teamweek::Api::Task
Posts tasks to Teamweek bulk_import url.
-
#import_users(data) ⇒ Teamweek::Api::User
Posts users to Teamweek bulk_import url.
-
#initialize(client, account_id, opts = {}) ⇒ Client
constructor
A new instance of Client.
Methods included from Importer
#bulk_import, #bulk_post, #bulk_uri
Constructor Details
#initialize(client, account_id, opts = {}) ⇒ Client
Returns a new instance of Client.
8 9 10 11 |
# File 'lib/teamweek/api/client.rb', line 8 def initialize(client, account_id, opts={}) @client = client set_base_uri(opts[:base_uri], account_id) end |
Instance Attribute Details
#base_uri ⇒ Object
Returns the value of attribute base_uri.
6 7 8 |
# File 'lib/teamweek/api/client.rb', line 6 def base_uri @base_uri end |
#client ⇒ Object
Returns the value of attribute client.
5 6 7 |
# File 'lib/teamweek/api/client.rb', line 5 def client @client end |
Instance Method Details
#import_projects(data) ⇒ Teamweek::Api::Project
Posts projects to Teamweek bulk_import url.
25 26 27 |
# File 'lib/teamweek/api/client.rb', line 25 def import_projects(data) bulk_import('projects', data, Teamweek::Api::Project) end |
#import_tasks(data) ⇒ Teamweek::Api::Task
Posts tasks to Teamweek bulk_import url.
33 34 35 |
# File 'lib/teamweek/api/client.rb', line 33 def import_tasks(data) bulk_import('tasks', data, Teamweek::Api::Task) end |
#import_users(data) ⇒ Teamweek::Api::User
Posts users to Teamweek bulk_import url.
17 18 19 |
# File 'lib/teamweek/api/client.rb', line 17 def import_users(data) bulk_import('users', data, Teamweek::Api::User) end |