class Authorization::DevelopmentSupport::ChangeSupporter::AbstractCompoundAction

Public Instance Methods

apply(candidate) click to toggle source
# File lib/declarative_authorization/development_support/change_supporter.rb, line 288
def apply (candidate)
  @actions.all? {|action| action.apply(candidate)}
end
hash() click to toggle source
# File lib/declarative_authorization/development_support/change_supporter.rb, line 300
def hash
  @hash ||= @actions.inject(0) {|memo, action| memo += action.hash }
end
resembles?(spec) click to toggle source
# File lib/declarative_authorization/development_support/change_supporter.rb, line 304
def resembles? (spec)
  @actions.any? {|action| action.resembles?(spec) } or
    to_a.any? do |array|
      min_length = [spec.length, array.length].min
      array[0,min_length] == spec[0,min_length]
    end
end
reverse?(other) click to toggle source
# File lib/declarative_authorization/development_support/change_supporter.rb, line 292
def reverse? (other)
  @actions.any? {|action| action.reverse?(other)}
end
to_a() click to toggle source
# File lib/declarative_authorization/development_support/change_supporter.rb, line 296
def to_a
  @actions.inject([]) {|memo, action| memo += action.to_a.first.is_a?(Enumerable) ? action.to_a : [action.to_a]; memo }
end
weight() click to toggle source
# File lib/declarative_authorization/development_support/change_supporter.rb, line 284
def weight
  @actions.sum(&:weight) + 1
end