Class: OmniFocus::Extrabrain::Task

Inherits:
Object
  • Object
show all
Defined in:
lib/omnifocus/extrabrain.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#idObject

Returns the value of attribute id.



10
11
12
# File 'lib/omnifocus/extrabrain.rb', line 10

def id
  @id
end

#project_idObject

Returns the value of attribute project_id.



10
11
12
# File 'lib/omnifocus/extrabrain.rb', line 10

def project_id
  @project_id
end

#project_titleObject



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

#teamObject

Returns the value of attribute team.



10
11
12
# File 'lib/omnifocus/extrabrain.rb', line 10

def team
  @team
end

#titleObject

Returns the value of attribute title.



10
11
12
# File 'lib/omnifocus/extrabrain.rb', line 10

def title
  @title
end

Instance Method Details

#ticket_idObject



26
27
28
# File 'lib/omnifocus/extrabrain.rb', line 26

def ticket_id
  "#{PREFIX}##{id}"
end

#urlObject



22
23
24
# File 'lib/omnifocus/extrabrain.rb', line 22

def url
  "https://#{team['subdomain']}.extrabrain.se/tasks/#{id}"
end