Class: Authorization::DevelopmentSupport::ChangeAnalyzer::Step

Inherits:
Array
  • Object
show all
Defined in:
lib/declarative_authorization/development_support/change_analyzer.rb

Instance Method Summary collapse

Instance Method Details

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)

147
148
149
150
151
152
153
154
155
156
# File 'lib/declarative_authorization/development_support/change_analyzer.rb', line 147

def eql? (other)
  # TODO use approach.users.index(self[idx]) ==
  #    other.approach.users.index(other[idx])
  # instead of user.login
  other.is_a?(Array) && other.length == length &&
      (0...length).all? {|idx| self[idx].class == other[idx].class &&
          ((self[idx].respond_to?(:to_sym) && self[idx].to_sym == other[idx].to_sym) ||
           (self[idx].respond_to?(:login) && self[idx]. == other[idx].) ||
           self[idx] == other[idx] ) }
end

#inspectObject


158
159
160
# File 'lib/declarative_authorization/development_support/change_analyzer.rb', line 158

def inspect
  collect {|info| info.respond_to?(:to_sym) ? info.to_sym : (info.respond_to?(:login) ? info. : info.class.name)}.inspect
end