Class: RedMilk

Inherits:
Object show all
Defined in:
lib/redmilk.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize {|_self| ... } ⇒ RedMilk

Returns a new instance of RedMilk.

Yields:

  • (_self)

Yield Parameters:

  • _self (RedMilk)

    the object that the method was called on



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/redmilk.rb', line 12

def initialize
  @http = Net::HTTP.new('www.rememberthemilk.com', 443)
  @http.use_ssl = true
  @http.verify_mode = OpenSSL::SSL::VERIFY_NONE

  @config = AppConfig.new('~/.redmilk.yaml')

  @token = get_token

  yield(self) if !authorization_url && block_given?
end

Instance Attribute Details

#authorization_urlObject (readonly)

Returns the value of attribute authorization_url.



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

def authorization_url
  @authorization_url
end

Instance Method Details

#inboxObject



32
33
34
# File 'lib/redmilk.rb', line 32

def inbox
  get_tasks :filter => "list:Inbox status:incomplete"
end

#listsObject



24
25
26
# File 'lib/redmilk.rb', line 24

def lists
  get_lists
end

#tasks_due(date = Date.today) ⇒ Object



28
29
30
# File 'lib/redmilk.rb', line 28

def tasks_due(date = Date.today)
  get_tasks :filter => ("((list:Inbox AND due:never) OR dueBefore:%s) AND status:incomplete" % date.tomorrow.strftime("%m/%d/%Y"))
end