| Class | Authorization::DevelopmentSupport::ChangeSupporter::AbstractAction |
| In: |
lib/declarative_authorization/development_support/change_supporter.rb
|
| Parent: | Object |
# File lib/declarative_authorization/development_support/change_supporter.rb, line 274
274: def self.readable_info (info)
275: if info.respond_to?(:to_sym)
276: info.to_sym.inspect
277: else
278: info.inspect
279: end
280: end
returns a list of instances of the action that may be applied
# File lib/declarative_authorization/development_support/change_supporter.rb, line 236
236: def self.specific_actions (candidate)
237: raise NotImplementedError, "Not yet?"
238: end
applies the specific action on the given candidate
# File lib/declarative_authorization/development_support/change_supporter.rb, line 241
241: def apply (candidate)
242: raise NotImplementedError, "Not yet?"
243: end
# File lib/declarative_authorization/development_support/change_supporter.rb, line 245
245: def eql? (other)
246: other.class == self.class and hash == other.hash
247: end
# File lib/declarative_authorization/development_support/change_supporter.rb, line 249
249: def hash
250: @hash ||= to_a.hash
251: end
# File lib/declarative_authorization/development_support/change_supporter.rb, line 257
257: def inspect
258: "#{self.class.name.demodulize} #{hash} #{to_a.hash} (#{to_a[1..-1].collect {|info| self.class.readable_info(info)} * ','})"
259: end
# File lib/declarative_authorization/development_support/change_supporter.rb, line 265
265: def resembles? (spec)
266: min_length = [spec.length, to_a.length].min
267: to_a[0,min_length] == spec[0,min_length]
268: end
# File lib/declarative_authorization/development_support/change_supporter.rb, line 270
270: def resembles_any? (specs)
271: specs.any? {|spec| resembles?(spec) }
272: end
# File lib/declarative_authorization/development_support/change_supporter.rb, line 253
253: def reverse? (other)
254: false
255: end