Class: MethodLog::MethodDefinition
- Inherits:
-
Object
- Object
- MethodLog::MethodDefinition
- Defined in:
- lib/method_log/method_definition.rb
Instance Attribute Summary collapse
-
#source_file ⇒ Object
readonly
Returns the value of attribute source_file.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #hash ⇒ Object
-
#initialize(source_file, lines) ⇒ MethodDefinition
constructor
A new instance of MethodDefinition.
- #source ⇒ Object
Constructor Details
#initialize(source_file, lines) ⇒ MethodDefinition
Returns a new instance of MethodDefinition.
5 6 7 8 |
# File 'lib/method_log/method_definition.rb', line 5 def initialize(source_file, lines) @source_file = source_file @lines = lines end |
Instance Attribute Details
#source_file ⇒ Object (readonly)
Returns the value of attribute source_file.
3 4 5 |
# File 'lib/method_log/method_definition.rb', line 3 def source_file @source_file end |
Instance Method Details
#==(other) ⇒ Object
10 11 12 |
# File 'lib/method_log/method_definition.rb', line 10 def ==(other) (source_file == other.source_file) && (lines == other.lines) end |
#hash ⇒ Object
14 15 16 |
# File 'lib/method_log/method_definition.rb', line 14 def hash [source_file, lines].hash end |
#source ⇒ Object
18 19 20 |
# File 'lib/method_log/method_definition.rb', line 18 def source source_file.snippet(lines) end |