Class: Pv::BugTracker
Instance Attribute Summary collapse
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#project ⇒ Object
readonly
Returns the value of attribute project.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Instance Method Summary collapse
-
#connected? ⇒ Boolean
Test whether we are connected.
-
#initialize(with_username = nil, and_password = nil, and_project_id = nil) ⇒ BugTracker
constructor
Connect to Pivotal Tracker.
-
#stories(by_user_name = nil) ⇒ Object
Find stories filtered by this username.
Constructor Details
#initialize(with_username = nil, and_password = nil, and_project_id = nil) ⇒ BugTracker
Connect to Pivotal Tracker
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/pv/bug_tracker.rb', line 8 def initialize with_username=nil, and_password=nil, and_project_id=nil @username = with_username || Pv.config.username @password = and_password || Pv.config.password @token = PivotalTracker::Client.token(username, password) @project = begin project_id = and_project_id || Pv.config.project_id PivotalTracker::Project.all.select { |p| p.id == project_id }.first if @token.present? end PivotalTracker::Client.use_ssl = true end |
Instance Attribute Details
#password ⇒ Object (readonly)
Returns the value of attribute password.
5 6 7 |
# File 'lib/pv/bug_tracker.rb', line 5 def password @password end |
#project ⇒ Object (readonly)
Returns the value of attribute project.
5 6 7 |
# File 'lib/pv/bug_tracker.rb', line 5 def project @project end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
5 6 7 |
# File 'lib/pv/bug_tracker.rb', line 5 def token @token end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
5 6 7 |
# File 'lib/pv/bug_tracker.rb', line 5 def username @username end |
Instance Method Details
#connected? ⇒ Boolean
Test whether we are connected.
22 23 24 |
# File 'lib/pv/bug_tracker.rb', line 22 def connected? @token.present? end |