Module: TaskMapper::Provider::Bcx
- Includes:
- Base
- Defined in:
- lib/provider/version.rb,
lib/provider/api/auth.rb,
lib/provider/api/todos.rb,
lib/provider/api/comments.rb,
lib/provider/api/projects.rb,
lib/provider/project.rb,
lib/provider/comment.rb,
lib/provider/ticket.rb,
lib/provider/bcx.rb,
lib/provider/api.rb
Defined Under Namespace
Classes: API, Comment, Project, Ticket
Constant Summary collapse
- VERSION =
"0.0.1"
Class Attribute Summary collapse
-
.account_id ⇒ Object
Returns the value of attribute account_id.
-
.api ⇒ Object
Returns the value of attribute api.
-
.password ⇒ Object
Returns the value of attribute password.
-
.username ⇒ Object
Returns the value of attribute username.
Class Method Summary collapse
Instance Method Summary collapse
Class Attribute Details
.account_id ⇒ Object
Returns the value of attribute account_id.
6 7 8 |
# File 'lib/provider/bcx.rb', line 6 def account_id @account_id end |
.api ⇒ Object
Returns the value of attribute api.
6 7 8 |
# File 'lib/provider/bcx.rb', line 6 def api @api end |
.password ⇒ Object
Returns the value of attribute password.
6 7 8 |
# File 'lib/provider/bcx.rb', line 6 def password @password end |
.username ⇒ Object
Returns the value of attribute username.
6 7 8 |
# File 'lib/provider/bcx.rb', line 6 def username @username end |
Class Method Details
.new(auth = {}) ⇒ Object
8 9 10 |
# File 'lib/provider/bcx.rb', line 8 def new(auth = {}) TaskMapper.new(:bcx, auth) end |
Instance Method Details
#authorize(auth = {}) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/provider/bcx.rb', line 17 def (auth = {}) @authenticator ||= TaskMapper::Authenticator.new(auth) unless auth[:username] && auth[:password] = "Please provide a username and password." raise TaskMapper::Exception.new end unless auth[:account_id] = "Please provide a Basecamp account_id" raise TaskMapper::Exception.new end provider.username = auth[:username] provider.password = auth[:password] provider.account_id = auth[:account_id] configure auth end |
#configure(auth) ⇒ Object
36 37 38 |
# File 'lib/provider/bcx.rb', line 36 def configure(auth) provider.api = API.new auth[:account_id], auth[:username], auth[:password] end |
#provider ⇒ Object
13 14 15 |
# File 'lib/provider/bcx.rb', line 13 def provider TaskMapper::Provider::Bcx end |
#valid? ⇒ Boolean
40 41 42 |
# File 'lib/provider/bcx.rb', line 40 def valid? provider.api.authenticated? end |