Class: PickyGuard::ResourceActions

Inherits:
Object
  • Object
show all
Defined in:
lib/picky_guard/resource_actions.rb

Direct Known Subclasses

ResourceActions

Instance Method Summary collapse

Instance Method Details

#action_exist?(resource, action) ⇒ Boolean

Returns:

  • (Boolean)


12
13
14
15
# File 'lib/picky_guard/resource_actions.rb', line 12

def action_exist?(resource, action)
  raise 'Unknown resource!' if safe_hash[resource].nil?
  safe_hash[resource].include? action
end

#map(resource, actions) ⇒ Object



7
8
9
10
# File 'lib/picky_guard/resource_actions.rb', line 7

def map(resource, actions)
  validate_parameters(actions, resource)
  safe_hash[resource] = actions
end