Module: Steep::Equatable
- Included in:
- TypeInference::SendArgs::BlockPassArg, TypeInference::SendArgs::KeywordArgs::ArgTypePairs, TypeInference::SendArgs::KeywordArgs::MissingKeyword, TypeInference::SendArgs::KeywordArgs::SplatArg, TypeInference::SendArgs::KeywordArgs::UnexpectedKeyword, TypeInference::SendArgs::PositionalArgs::MissingArg, TypeInference::SendArgs::PositionalArgs::NodeParamPair, TypeInference::SendArgs::PositionalArgs::NodeTypePair, TypeInference::SendArgs::PositionalArgs::SplatArg, TypeInference::SendArgs::PositionalArgs::UnexpectedArg
- Defined in:
- lib/steep/equatable.rb
Instance Method Summary collapse
Instance Method Details
#==(other) ⇒ Object
3 4 5 6 7 8 9 10 11 |
# File 'lib/steep/equatable.rb', line 3 def ==(other) if other.class == self.class instance_variables.all? do |name| other.instance_variable_get(name) == instance_variable_get(name) end else false end end |
#eql?(other) ⇒ Boolean
13 14 15 |
# File 'lib/steep/equatable.rb', line 13 def eql?(other) self == other end |
#hash ⇒ Object
17 18 19 20 21 |
# File 'lib/steep/equatable.rb', line 17 def hash instance_variables.inject(self.class.hash) do |hash, name| hash ^ instance_variable_get(name).hash end end |