Sha256: e4f785252d26c157679c76276189824958e3a10032a72695fe453cf35cab6ddb
Contents?: true
Size: 1 KB
Versions: 4
Compression:
Stored size: 1 KB
Contents
module CanTango::Ability::Executor class Base < CanTango::Ability::Base include CanTango::Ability::Executor include CanTango::Ability::Callbacks include CanTango::Ability::Builder attr_reader :ability, :modes, :options, :executed delegate :candidate, :to => :ability def initialize ability, options = {} raise ArgumentError, "Ability must be something!" if !ability raise ArgumentError, "Ability must be a kind of CanTango::Ability::Base" if !ability.kind_of?(CanTango::Ability::Base) raise ArgumentError, "Options must be a hash" if !options.kind_of?(Hash) @ability = ability @options ||= options 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 def executed? @executed end def calculate_rules super end end end
Version data entries
4 entries across 4 versions & 1 rubygems