Class: ATM::RTM

Inherits:
Object show all
Defined in:
lib/atm/rtm.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(java_class) ⇒ RTM

Returns a new instance of RTM.



51
52
53
# File 'lib/atm/rtm.rb', line 51

def initialize(java_class)
  @class = java_class.to_s.camelcase
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(symbol, args = {}) ⇒ Object



55
56
57
58
59
60
61
62
# File 'lib/atm/rtm.rb', line 55

def method_missing(symbol, args = {})
  if @class == "tasks" and symbol.to_s == "notes"
    RTM.new "tasks.notes"
  else
    method = symbol.to_s.camelcase
    Requester.instance.request "rtm.#{@class}.#{method}", args
  end
end

Class Method Details

.method_missing(symbol) ⇒ Object



68
69
70
# File 'lib/atm/rtm.rb', line 68

def RTM.method_missing(symbol)
  RTM.new symbol
end

.testObject



64
65
66
# File 'lib/atm/rtm.rb', line 64

def RTM.test
  RTM.new :test
end