lib/canard/abilities.rb in canard-0.2.2 vs lib/canard/abilities.rb in canard-0.2.3

- old
+ new

@@ -1,22 +1,28 @@ module Canard class Abilities - @definitions = {} - @definition_paths = ['app/abilities'] + @definitions = {} + @default_path = 'app/abilities' class << self - attr_accessor :definition_paths + attr_accessor :default_path + attr_writer :definition_paths + attr_reader :definitions + def definition_paths + @definition_paths ||= [@default_path] + end + def for(name, &block) raise ArgumentError.new('No block of ability definitions given') unless block_given? @definitions[name.to_sym] = block end end end -end \ No newline at end of file +end