Class: Slimembedcop::Extractor
- Inherits:
-
Object
- Object
- Slimembedcop::Extractor
- Defined in:
- lib/slimembedcop/extractor.rb
Overview
Extract Ruby codes from Slim embedded code.
Instance Method Summary collapse
-
#initialize(source) ⇒ Extractor
constructor
A new instance of Extractor.
- #run ⇒ Object
Constructor Details
#initialize(source) ⇒ Extractor
Returns a new instance of Extractor.
6 7 8 |
# File 'lib/slimembedcop/extractor.rb', line 6 def initialize(source) @source = source end |
Instance Method Details
#run ⇒ Object
10 11 12 13 14 |
# File 'lib/slimembedcop/extractor.rb', line 10 def run ranges.map do |(begin_, end_)| { code: @source[begin_...end_], offset: begin_ } end end |