Sha256: 14e9c7f7a4dcadd5fd6e5ebab0939bed34bab979b0a3f98978e4d5185963bc1c

Contents?: true

Size: 736 Bytes

Versions: 2

Compression:

Stored size: 736 Bytes

Contents

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

    attr_reader :candidate, :modes, :options, :executed

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

    def executed?
      @executed
    end
    
    def calculate_rules
      super
    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.7 lib/cantango/ability/executor/base.rb
cantango-core-0.1.6 lib/cantango/ability/executor/base.rb