Class: MethodLog::MethodDefinition
- Inherits:
-
Object
- Object
- MethodLog::MethodDefinition
- Defined in:
- lib/method_log/method_definition.rb
Instance Method Summary collapse
- #==(other) ⇒ Object
- #hash ⇒ Object
-
#initialize(source_file: nil, lines: nil) ⇒ MethodDefinition
constructor
A new instance of MethodDefinition.
- #to_s ⇒ Object
Constructor Details
#initialize(source_file: nil, lines: nil) ⇒ MethodDefinition
Returns a new instance of MethodDefinition.
3 4 5 6 |
# File 'lib/method_log/method_definition.rb', line 3 def initialize(source_file: nil, lines: nil) @source_file = source_file @lines = lines end |
Instance Method Details
#==(other) ⇒ Object
8 9 10 |
# File 'lib/method_log/method_definition.rb', line 8 def ==(other) (source_file == other.source_file) && (lines == other.lines) end |
#hash ⇒ Object
12 13 14 |
# File 'lib/method_log/method_definition.rb', line 12 def hash [source_file, lines].hash end |
#to_s ⇒ Object
16 17 18 19 20 21 |
# File 'lib/method_log/method_definition.rb', line 16 def to_s [ "#{source_file.path}:#{lines}", source_file.snippet(lines) ].join($/) end |