Class Authorization::DevelopmentSupport::ChangeSupporter::AbstractCompoundAction
In: lib/declarative_authorization/development_support/change_supporter.rb
Parent: AbstractAction

Methods

apply   hash   resembles?   reverse?   to_a   weight  

Public Instance methods

[Source]

     # File lib/declarative_authorization/development_support/change_supporter.rb, line 288
288:         def apply (candidate)
289:           @actions.all? {|action| action.apply(candidate)}
290:         end

[Source]

     # File lib/declarative_authorization/development_support/change_supporter.rb, line 300
300:         def hash
301:           @hash ||= @actions.inject(0) {|memo, action| memo += action.hash }
302:         end

[Source]

     # File lib/declarative_authorization/development_support/change_supporter.rb, line 304
304:         def resembles? (spec)
305:           @actions.any? {|action| action.resembles?(spec) } or
306:             to_a.any? do |array|
307:               min_length = [spec.length, array.length].min
308:               array[0,min_length] == spec[0,min_length]
309:             end
310:         end

[Source]

     # File lib/declarative_authorization/development_support/change_supporter.rb, line 292
292:         def reverse? (other)
293:           @actions.any? {|action| action.reverse?(other)}
294:         end

[Source]

     # File lib/declarative_authorization/development_support/change_supporter.rb, line 296
296:         def to_a
297:           @actions.inject([]) {|memo, action| memo += action.to_a.first.is_a?(Enumerable) ? action.to_a : [action.to_a]; memo }
298:         end

[Source]

     # File lib/declarative_authorization/development_support/change_supporter.rb, line 284
284:         def weight
285:           @actions.sum(&:weight) + 1
286:         end

[Validate]