Sha256: bc82fe8c78e3e2ee2ff82e882414fd087d791ef291a4d4540fe3537b97289076

Contents?: true

Size: 731 Bytes

Versions: 2

Compression:

Stored size: 731 Bytes

Contents

module CanTango::Ability::Executor
  class Base
    include CanTango::Ability::Executor
    include CanTango::Ability::Callbacks

    attr_reader :candidate, :modes, :options

    def initialize candidate, options = {}
      raise ArgumentError, "Candidate must be something!" if !candidate
      @candidate, @options = [candidate, options]
    end

    def rules
      raise NotImplementedError
    end
    
    def calculate_rules
      raise NotImplementedError
    end

    def self.inherited(base)
      base.send :include, CanTango::Helpers::Debug
      base.send :include, CanTango::Ability::Executor
      base.send :include, CanTango::Ability::Rules
      base.send :include, CanTango::Ability::Callbacks
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cantango-core-0.1.5 lib/cantango/ability/executor/base.rb
cantango-core-0.1.4 lib/cantango/ability/executor/base.rb