Class: Canard::Abilities

Inherits:
Object
  • Object
show all
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



9
10
11
# File 'lib/canard/abilities.rb', line 9

def default_path
  @default_path
end

.definition_pathsObject



15
16
17
# File 'lib/canard/abilities.rb', line 15

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

.definitionsObject (readonly)

Returns the value of attribute definitions



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

def definitions
  @definitions
end

Class Method Details

.for(name, &block) ⇒ Object

Raises:

  • (ArgumentError)


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

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