Class: Kilt

Inherits:
Object
  • Object
show all
Includes:
Crack
Defined in:
lib/kilt.rb

Overview

require ‘snarl’ if RUBY_PLATFORM =~ /mswin|mingw|win32/

Constant Summary collapse

ICON =
File.expand_path(File.join(File.dirname(__FILE__), '..', 'img', 'pivotal.png'))

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#date_last_activityObject (readonly)

Returns the value of attribute date_last_activity.



9
10
11
# File 'lib/kilt.rb', line 9

def date_last_activity
  @date_last_activity
end

#idObject (readonly)

Returns the value of attribute id.



9
10
11
# File 'lib/kilt.rb', line 9

def id
  @id
end

Class Method Details

.init(token) ⇒ Object



19
20
21
# File 'lib/kilt.rb', line 19

def self.init(token) 
  new token
end

Instance Method Details

#pivotal_format_dateObject



23
24
25
# File 'lib/kilt.rb', line 23

def pivotal_format_date
  URI.escape(date_last_activity.strftime("%Y/%m/%d %H:%M:%S"))
end

#updateObject



27
28
29
30
31
32
33
34
35
# File 'lib/kilt.rb', line 27

def update
  activities = fetch_activities
  activities.reverse.each do |activity|
    if activity['occurred_at'] > @date_last_activity
      notify_about activity['description']
    end
  end
  update_date_from activities
end