Module: ActioncableAutoParam::ClassMethods

Defined in:
lib/actioncable_auto_param.rb

Instance Method Summary collapse

Instance Method Details

#auto_param(*method_names) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/actioncable_auto_param.rb', line 6

def auto_param(*method_names)
  method_names.each do |method_name|
    if method_name == :all
      self.auto_param_all_methods = true
    end

    self.auto_param_methods ||= []
    self.auto_param_methods.push(method_name)
  end
end

#auto_param?(method_name) ⇒ Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/actioncable_auto_param.rb', line 17

def auto_param?(method_name)
  auto_param_all_methods || (auto_param_methods || []).include?(method_name)
end