Module: Gearhead::Extensions::Actions
- Included in:
- Gear
- Defined in:
- lib/gearhead/extensions/actions.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
Instance Method Details
#action_enabled?(action) ⇒ Boolean
23 24 25 |
# File 'lib/gearhead/extensions/actions.rb', line 23 def action_enabled?(action) @_gear_enabled_actions.include?(action) end |
#actions(*args) ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/gearhead/extensions/actions.rb', line 12 def actions(*args) = args. @_gear_enabled_actions = if [:except] @_gear_enabled_actions - [:except].map(&:to_sym) elsif [:only] [:only].map(&:to_sym) else args.map(&:to_sym) end end |
#disable_actions(*actions) ⇒ Object
8 9 10 |
# File 'lib/gearhead/extensions/actions.rb', line 8 def disable_actions(*actions) @_gear_enabled_actions -= actions.map(&:to_sym) end |