Module: ActionService::ActionControllerExtension::ClassMethods

Included in:
ActionController::Base
Defined in:
lib/active_service/action_controller_extension.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#service_namesObject

Returns the value of attribute service_names.



14
15
16
# File 'lib/active_service/action_controller_extension.rb', line 14

def service_names
  @service_names
end

#servicesObject

Returns the value of attribute services.



14
15
16
# File 'lib/active_service/action_controller_extension.rb', line 14

def services
  @services
end

Instance Method Details

#service(*names) ⇒ Object



16
17
18
19
20
21
22
23
# File 'lib/active_service/action_controller_extension.rb', line 16

def service(*names)
  @services ||= {}
  @service_names ||= []
  names.each do |name| 
    @services[name] = "#{name.to_s.humanize}Service".constantize.new
    @service_names << name 
  end
end