Class: OmniFocus::Extrabrain::Task
- Inherits:
-
Object
- Object
- OmniFocus::Extrabrain::Task
- Defined in:
- lib/omnifocus/extrabrain.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#project_id ⇒ Object
Returns the value of attribute project_id.
- #project_title ⇒ Object
-
#team ⇒ Object
Returns the value of attribute team.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(attrs = {}) ⇒ Task
constructor
A new instance of Task.
- #ticket_id ⇒ Object
- #url ⇒ Object
Constructor Details
#initialize(attrs = {}) ⇒ Task
Returns a new instance of Task.
13 14 15 16 17 18 19 20 |
# File 'lib/omnifocus/extrabrain.rb', line 13 def initialize(attrs = {}) attrs.each do |attribute, value| setter = "#{attribute}=" if respond_to? setter public_send setter, value end end end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
10 11 12 |
# File 'lib/omnifocus/extrabrain.rb', line 10 def id @id end |
#project_id ⇒ Object
Returns the value of attribute project_id.
10 11 12 |
# File 'lib/omnifocus/extrabrain.rb', line 10 def project_id @project_id end |
#project_title ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/omnifocus/extrabrain.rb', line 30 def project_title if @project_title.to_s.gsub(' ', '') == '' 'Miscellaneous' else @project_title end end |
#team ⇒ Object
Returns the value of attribute team.
10 11 12 |
# File 'lib/omnifocus/extrabrain.rb', line 10 def team @team end |
#title ⇒ Object
Returns the value of attribute title.
10 11 12 |
# File 'lib/omnifocus/extrabrain.rb', line 10 def title @title end |
Instance Method Details
#ticket_id ⇒ Object
26 27 28 |
# File 'lib/omnifocus/extrabrain.rb', line 26 def ticket_id "#{PREFIX}##{id}" end |
#url ⇒ Object
22 23 24 |
# File 'lib/omnifocus/extrabrain.rb', line 22 def url "https://#{team['subdomain']}.extrabrain.se/tasks/#{id}" end |