Skip to content

Commit

Permalink
exercism#37 - memoize body_line_numbers method
Browse files Browse the repository at this point in the history
  • Loading branch information
Hunk13 committed Apr 9, 2024
1 parent ba9455f commit d1ba3aa
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/extract_test_metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ def code_for_line(one_indexed_idx)
filelines[one_indexed_idx - 1]
end

memoize
def body_line_numbers
# Get the lines excluding the first (def) and last (end)
((test_node.first_line + 1)..(test_node.last_line - 1))
Expand Down

0 comments on commit d1ba3aa

Please sign in to comment.