--- !ruby/object:RI::MethodDescription 
aliases: []

block_params: 
comment: 
- !ruby/struct:SM::Flow::P 
  body: Declares a web service that will provide access to the API of the given <tt>object</tt>. <tt>object</tt> must be an ActionWebService::Base derivative.
- !ruby/struct:SM::Flow::P 
  body: Web service object creation can either be <em>immediate</em>, where the object instance is given at class definition time, or <em>deferred</em>, where object instantiation is delayed until request time.
- !ruby/struct:SM::Flow::H 
  level: 4
  text: Immediate web service object example
- !ruby/struct:SM::Flow::VERB 
  body: "  class ApiController &lt; ApplicationController\n    web_service_dispatching_mode :delegated\n\n    web_service :person, PersonService.new\n  end\n"
- !ruby/struct:SM::Flow::P 
  body: For deferred instantiation, a block should be given instead of an object instance. This block will be executed in controller instance context, so it can rely on controller instance variables being present.
- !ruby/struct:SM::Flow::H 
  level: 4
  text: Deferred web service object example
- !ruby/struct:SM::Flow::VERB 
  body: "  class ApiController &lt; ApplicationController\n    web_service_dispatching_mode :delegated\n\n    web_service(:person) { PersonService.new(request.env) }\n  end\n"
full_name: ActionWebService::Container::Delegated::ClassMethods#web_service
is_singleton: false
name: web_service
params: (name, object=nil, &block)
visibility: public
