Class: Pippi::Checks::MethodSequenceFinder::Record

Inherits:
Object
  • Object
show all
Defined in:
lib/pippi/checks/method_sequence_finder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, lineno, meth1, meth2) ⇒ Record

Returns a new instance of Record.



37
38
39
40
41
42
# File 'lib/pippi/checks/method_sequence_finder.rb', line 37

def initialize(path, lineno, meth1, meth2)
  @path = path
  @lineno = lineno
  @meth1 = meth1
  @meth2 = meth2
end

Instance Attribute Details

#linenoObject (readonly)

Returns the value of attribute lineno.



36
37
38
# File 'lib/pippi/checks/method_sequence_finder.rb', line 36

def lineno
  @lineno
end

#meth1Object (readonly)

Returns the value of attribute meth1.



36
37
38
# File 'lib/pippi/checks/method_sequence_finder.rb', line 36

def meth1
  @meth1
end

#meth2Object (readonly)

Returns the value of attribute meth2.



36
37
38
# File 'lib/pippi/checks/method_sequence_finder.rb', line 36

def meth2
  @meth2
end

#pathObject (readonly)

Returns the value of attribute path.



36
37
38
# File 'lib/pippi/checks/method_sequence_finder.rb', line 36

def path
  @path
end

Instance Method Details

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


43
44
45
# File 'lib/pippi/checks/method_sequence_finder.rb', line 43

def eql?(other)
  path == other.path && lineno == other.lineno && meth1 == other.meth1 && meth2 == other.meth2
end

#hashObject



46
47
48
49
# File 'lib/pippi/checks/method_sequence_finder.rb', line 46

def hash
  require 'zlib'
  Zlib.crc32("#{path}:#{lineno}:#{meth1}:#{meth2}")
end