Class: ActiveProject::Adapters::BasecampAdapter
- Includes:
- ActiveProject::Adapters::Basecamp::Comments, ActiveProject::Adapters::Basecamp::Connection, ActiveProject::Adapters::Basecamp::Issues, ActiveProject::Adapters::Basecamp::Lists, ActiveProject::Adapters::Basecamp::Projects, ActiveProject::Adapters::Basecamp::Webhooks
- Defined in:
- lib/active_project/adapters/basecamp_adapter.rb
Overview
Adapter for interacting with the Basecamp 3 API. Implements the interface defined in ActiveProject::Adapters::Base. API Docs: github.com/basecamp/bc3-api
Constant Summary
Constants included from ActiveProject::Adapters::Basecamp::Connection
ActiveProject::Adapters::Basecamp::Connection::BASE_URL_TEMPLATE
Constants included from Connections::HttpClient
Connections::HttpClient::DEFAULT_HEADERS, Connections::HttpClient::DEFAULT_RETRY_OPTS
Instance Attribute Summary collapse
-
#base_url ⇒ Object
readonly
Returns the value of attribute base_url.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Attributes included from Connections::HttpClient
Instance Method Summary collapse
-
#connected? ⇒ Boolean
Checks if the adapter can successfully authenticate and connect to the service.
-
#get_current_user ⇒ ActiveProject::Resources::User
Retrieves details for the currently authenticated user.
-
#issues ⇒ ResourceFactory<Resources::Issue>
Returns a factory for Issue resources (To-dos).
-
#projects ⇒ ResourceFactory<Resources::Project>
Returns a factory for Project resources.
Methods included from ActiveProject::Adapters::Basecamp::Webhooks
Methods included from ActiveProject::Adapters::Basecamp::Lists
#create_list, #find_first_todolist_id
Methods included from ActiveProject::Adapters::Basecamp::Comments
#add_comment, #delete_comment, #update_comment
Methods included from ActiveProject::Adapters::Basecamp::Issues
#create_issue, #delete_issue, #find_issue, #list_issues, #update_issue
Methods included from ActiveProject::Adapters::Basecamp::Projects
#create_project, #delete_project, #find_project, #list_projects, #untrash_project
Methods included from ActiveProject::Adapters::Basecamp::Connection
Methods included from Connections::Rest
Methods included from Connections::Pagination
Methods included from Connections::HttpClient
Methods included from Connections::Base
Methods inherited from Base
#add_comment, #create_issue, #create_list, #create_project, #delete_comment, #delete_issue, #delete_project, #denormalize_status, #find_issue, #find_project, #initialize, #list_issues, #list_projects, #normalize_status, #parse_webhook, #status_known?, #supports_webhooks?, #update_comment, #update_issue, #valid_statuses, #verify_webhook_signature, #webhook_type, webhook_type
Instance Attribute Details
#base_url ⇒ Object (readonly)
Returns the value of attribute base_url.
14 15 16 |
# File 'lib/active_project/adapters/basecamp_adapter.rb', line 14 def base_url @base_url end |
#config ⇒ Object (readonly)
Returns the value of attribute config.
14 15 16 |
# File 'lib/active_project/adapters/basecamp_adapter.rb', line 14 def config @config end |
Instance Method Details
#connected? ⇒ Boolean
Checks if the adapter can successfully authenticate and connect to the service. Calls #get_current_user internally and catches authentication errors.
51 52 53 54 55 56 |
# File 'lib/active_project/adapters/basecamp_adapter.rb', line 51 def connected? get_current_user true rescue ActiveProject::AuthenticationError false end |
#get_current_user ⇒ ActiveProject::Resources::User
Retrieves details for the currently authenticated user.
43 44 45 46 |
# File 'lib/active_project/adapters/basecamp_adapter.rb', line 43 def get_current_user user_data = make_request(:get, "my/profile.json") map_user_data(user_data) end |
#issues ⇒ ResourceFactory<Resources::Issue>
Returns a factory for Issue resources (To-dos).
33 34 35 |
# File 'lib/active_project/adapters/basecamp_adapter.rb', line 33 def issues ResourceFactory.new(adapter: self, resource_class: Resources::Issue) end |
#projects ⇒ ResourceFactory<Resources::Project>
Returns a factory for Project resources.
27 28 29 |
# File 'lib/active_project/adapters/basecamp_adapter.rb', line 27 def projects ResourceFactory.new(adapter: self, resource_class: Resources::Project) end |