Class: Canard::Abilities
- Inherits:
-
Object
- Object
- Canard::Abilities
- Extended by:
- Forwardable
- Defined in:
- lib/canard/abilities.rb
Class Attribute Summary collapse
-
.default_path ⇒ Object
Returns the value of attribute default_path.
- .definition_paths ⇒ Object
-
.definitions ⇒ Object
readonly
Returns the value of attribute definitions.
Class Method Summary collapse
Class Attribute Details
.default_path ⇒ Object
Returns the value of attribute default_path.
13 14 15 |
# File 'lib/canard/abilities.rb', line 13 def default_path @default_path end |
.definition_paths ⇒ Object
19 20 21 |
# File 'lib/canard/abilities.rb', line 19 def definition_paths @definition_paths ||= [@default_path] end |
.definitions ⇒ Object (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
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 |