Class: SourceCode::Method
- Inherits:
-
Object
- Object
- SourceCode::Method
- Defined in:
- lib/source_code/method.rb
Instance Attribute Summary collapse
-
#source_location ⇒ Object
readonly
Returns the value of attribute source_location.
Instance Method Summary collapse
-
#initialize(source_location) ⇒ Method
constructor
A new instance of Method.
- #source_code ⇒ Object
Constructor Details
#initialize(source_location) ⇒ Method
7 8 9 |
# File 'lib/source_code/method.rb', line 7 def initialize source_location @source_location = source_location end |
Instance Attribute Details
#source_location ⇒ Object (readonly)
Returns the value of attribute source_location.
5 6 7 |
# File 'lib/source_code/method.rb', line 5 def source_location @source_location end |
Instance Method Details
#source_code ⇒ Object
11 12 13 |
# File 'lib/source_code/method.rb', line 11 def source_code lines[first_line...last_line].join end |