class MilkCap::RTM::MilkResource
A parent class for Task
, List
and co.
Never use directly.
Public Class Methods
new(hsh)
click to toggle source
# File lib/milk_cap/rtm/resources.rb, line 33 def initialize (hsh) @hsh = hsh end
Protected Class Methods
execute(method_name, args={})
click to toggle source
Calls the milk() method (interacts with the RTM
API).
# File lib/milk_cap/rtm/resources.rb, line 56 def self.execute (method_name, args={}) args[:method] = "rtm.#{resource_name}.#{method_name}" MilkCap::RTM.milk(args) end
resource_name()
click to toggle source
Returns the name of the resource as the API knows it (for example 'tasks' or 'lists').
# File lib/milk_cap/rtm/resources.rb, line 66 def self.resource_name self.to_s.split('::')[-1].downcase + 's' end
timeline()
click to toggle source
Returns the current timeline (fetches one if none has yet been prepared).
# File lib/milk_cap/rtm/resources.rb, line 81 def self.timeline @@timeline ||= MilkCap::RTM.get_timeline end
Protected Instance Methods
timeline()
click to toggle source
Simply calls the timeline() class method.
# File lib/milk_cap/rtm/resources.rb, line 73 def timeline MilkResource.timeline end