Class: RememberTheMilkAPINamespace

Inherits:
Object
  • Object
show all
Defined in:
lib/thartmx_lib.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.



446
447
448
449
# File 'lib/thartmx_lib.rb', line 446

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



451
452
453
454
# File 'lib/thartmx_lib.rb', line 451

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