Module: SimpleAction::AcceptsParams
- Extended by:
- ActiveSupport::Concern
- Included in:
- Service
- Defined in:
- lib/simple_action/concerns/accepts_params.rb
Instance Attribute Summary collapse
-
#params_class ⇒ Object
Returns the value of attribute params_class.
Instance Method Summary collapse
Instance Attribute Details
#params_class ⇒ Object
Returns the value of attribute params_class.
8 9 10 |
# File 'lib/simple_action/concerns/accepts_params.rb', line 8 def params_class @params_class end |
Instance Method Details
#api_pie_documentation ⇒ Object
21 22 23 |
# File 'lib/simple_action/concerns/accepts_params.rb', line 21 def api_pie_documentation @params_class.api_pie_documentation end |
#params(&block) ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/simple_action/concerns/accepts_params.rb', line 10 def params(&block) klass_name = self.model_name.to_s klass_name = klass_name + "Params" @params_class = Class.new(SimpleAction::Params).tap do |klass| extend ActiveModel::Naming klass.with_rails_helpers self.const_set(klass_name, klass) klass.class_eval(&block) end end |