Class: RememberTheMilkAPINamespace

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

Overview

this is just a helper class so that you can do things like rtm.test.echo. the method_missing in RememberTheMilkAPI returns one of these. this class is the “test” portion of the programming. its method_missing then get invoked with “echo” as the symbol. it has stored a reference to the original rtm object, so it can then invoke call_api_method

Instance Method Summary collapse

Constructor Details

#initialize(namespace, rtm) ⇒ RememberTheMilkAPINamespace

Returns a new instance of RememberTheMilkAPINamespace.



418
419
420
421
# File 'lib/rtmapi.rb', line 418

def initialize(namespace, rtm)
  @namespace = namespace
  @rtm = rtm
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(symbol, *args) ⇒ Object



423
424
425
426
# File 'lib/rtmapi.rb', line 423

def method_missing( symbol, *args )
  method_name = symbol.id2name
  @rtm.call_api_method( "#{@namespace}.#{method_name}", *args)
end