Class: EvadosTracker::Core
- Inherits:
-
Object
- Object
- EvadosTracker::Core
- Defined in:
- lib/evados_tracker.rb,
lib/evados_tracker/core.rb
Instance Attribute Summary collapse
-
#current_isssue_id ⇒ Object
Returns the value of attribute current_isssue_id.
-
#current_issue_id ⇒ Object
Returns the value of attribute current_issue_id.
-
#key ⇒ Object
Returns the value of attribute key.
-
#numerated_list ⇒ Object
Returns the value of attribute numerated_list.
-
#pomodoro_id ⇒ Object
Returns the value of attribute pomodoro_id.
Instance Method Summary collapse
- #commit_pomodoro ⇒ Object
- #create_pomodoro ⇒ Object
- #delete_pomodoro ⇒ Object
- #get_tasks ⇒ Object
-
#initialize(key) ⇒ Core
constructor
A new instance of Core.
Constructor Details
#initialize(key) ⇒ Core
Returns a new instance of Core.
8 9 10 11 12 13 |
# File 'lib/evados_tracker.rb', line 8 def initialize(key) @key = key @current_issue_id @pomodoro_id @numerated_list = {} end |
Instance Attribute Details
#current_isssue_id ⇒ Object
Returns the value of attribute current_isssue_id.
3 4 5 |
# File 'lib/evados_tracker/core.rb', line 3 def current_isssue_id @current_isssue_id end |
#current_issue_id ⇒ Object
Returns the value of attribute current_issue_id.
6 7 8 |
# File 'lib/evados_tracker.rb', line 6 def current_issue_id @current_issue_id end |
#key ⇒ Object
Returns the value of attribute key.
6 7 8 |
# File 'lib/evados_tracker.rb', line 6 def key @key end |
#numerated_list ⇒ Object
Returns the value of attribute numerated_list.
6 7 8 |
# File 'lib/evados_tracker.rb', line 6 def numerated_list @numerated_list end |
#pomodoro_id ⇒ Object
Returns the value of attribute pomodoro_id.
6 7 8 |
# File 'lib/evados_tracker.rb', line 6 def pomodoro_id @pomodoro_id end |
Instance Method Details
#commit_pomodoro ⇒ Object
30 31 32 33 |
# File 'lib/evados_tracker.rb', line 30 def commit_pomodoro response = HTTParty.put("http://pm.evados.com/api/v1/issues/" + "#{@current_issue_id}" + "/pomodoros/" + "#{@pomodoro_id}" + ".json?auth_token=" + "#{@key}") end |
#create_pomodoro ⇒ Object
23 24 25 26 27 28 |
# File 'lib/evados_tracker.rb', line 23 def create_pomodoro check_rescue do @pomodoro_id = HTTParty.post("http://pm.evados.com/api/v1/issues/" + "#{@current_issue_id}" + "/pomodoros.json?auth_token=" + "#{@key}") end end |
#delete_pomodoro ⇒ Object
35 36 37 38 39 40 |
# File 'lib/evados_tracker.rb', line 35 def delete_pomodoro check_rescue do response = HTTParty.delete("http://pm.evados.com/api/v1/issues/" + "#{@current_issue_id}" + "/pomodoros/" + "#{@pomodoro_id}" + ".json?auth_token=" + "#{@key}") end end |
#get_tasks ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/evados_tracker.rb', line 15 def get_tasks check_rescue do response = HTTParty.get("http://pm.evados.com/api/v1/issues.json?auth_token=" + "#{@key}") numerate_task_list response response end end |