Class: Curbala::Service
- Inherits:
-
Object
- Object
- Curbala::Service
- Defined in:
- lib/curbala/service.rb
Direct Known Subclasses
Class Method Summary collapse
-
.invoke(action_name, args_hash = {}, associated_model = nil, logger = nil, simulated_status = 200, inject_response = nil) ⇒ Object
enhancement : config specifies format of response, action base class supports xml and json config-based unpacking, keep unpack_response base class and extending class implementation enhancement : config to specify unpack method.
Class Method Details
.invoke(action_name, args_hash = {}, associated_model = nil, logger = nil, simulated_status = 200, inject_response = nil) ⇒ Object
enhancement : config specifies format of response, action base class supports xml and json config-based unpacking, keep unpack_response base class and extending class implementation enhancement : config to specify unpack method. altho at service-level, may want flexibility for each action to do its own thing. there’s a reasonable strategy somewhere…
7 8 9 10 |
# File 'lib/curbala/service.rb', line 7 def self.invoke(action_name, args_hash={}, associated_model=nil, logger=nil, simulated_status=200, inject_response=nil) logger ||= self.find_or_create_logger(associated_model) action = eval("#{service_qualifier}::#{action_name.to_s.camelize}.new(service_url_segment(associated_model), env_service_config, args_hash, logger, simulated_status, inject_response)") end |