Method: RTX::API::Client#method_missing

Defined in:
lib/rtx/api/client.rb

#method_missing(method, *args, &block) ⇒ Object


40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/rtx/api/client.rb', line 40

def method_missing(method, *args, &block)
  allowed_resources = API::Resources.allowed_resources
  method_name = method.to_s

  if allowed_resources.include? method_name
    attrs = {}
    if args.size > 0
      attrs = args.last.is_a?(Hash) ? args.pop : {}
    end
    RTX::API::Collection.new(self, method_name, attrs)
  end
end