Sha256: b5b4be3134a5a706d43782da882ddd70dadb66634d5abdecd9d568bd38da1d22

Contents?: true

Size: 540 Bytes

Versions: 14

Compression:

Stored size: 540 Bytes

Contents

module Canard
  class Abilities
  
    @definitions      = {}
    @default_path     = 'app/abilities'

    class << self

      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

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
canard-0.4.2.pre lib/canard/abilities.rb
canard-0.4.1 lib/canard/abilities.rb
canard-0.4.0 lib/canard/abilities.rb
canard-0.4.0.pre lib/canard/abilities.rb
canard-0.3.7 lib/canard/abilities.rb
canard-0.3.6 lib/canard/abilities.rb
canard-0.3.5 lib/canard/abilities.rb
canard-0.3.4 lib/canard/abilities.rb
canard-0.3.2 lib/canard/abilities.rb
canard-0.3.1 lib/canard/abilities.rb
canard-0.2.7 lib/canard/abilities.rb
canard-0.2.5 lib/canard/abilities.rb
canard-0.2.4 lib/canard/abilities.rb
canard-0.2.3 lib/canard/abilities.rb