Class: Canard::Abilities

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/canard/abilities.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.default_pathObject

Returns the value of attribute default_path.



13
14
15
# File 'lib/canard/abilities.rb', line 13

def default_path
  @default_path
end

.definition_pathsObject



19
20
21
# File 'lib/canard/abilities.rb', line 19

def definition_paths
  @definition_paths ||= [@default_path]
end

.definitionsObject (readonly)

Returns the value of attribute definitions.



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

def definitions
  @definitions
end

Class Method Details

.for(name, &block) ⇒ Object

Raises:

  • (ArgumentError)


23
24
25
26
27
# File 'lib/canard/abilities.rb', line 23

def for(name, &block)
  raise ArgumentError.new('No block of ability definitions given') unless block_given?
  key = ability_key(name)
  @definitions[key] = block
end