Class: Organizer
- Inherits:
-
Object
- Object
- Organizer
- Defined in:
- lib/organizer.rb,
lib/organizer/config.rb,
lib/organizer/request.rb,
lib/organizer/response.rb
Defined Under Namespace
Classes: APIException, Config, MissingIdException, Request, Response
Instance Method Summary collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args) ⇒ Object
7 8 9 10 11 12 |
# File 'lib/organizer.rb', line 7 def method_missing(method, *args) params = args[0].is_a?(Hash) ? args[0] : {} raise MissingIdException.new("#{method.capitalize} id can not be empty.") unless params[:id] path = "#{method}/#{params.delete(:id)}/" Request.new(path, params) end |