Class: Slimcop::RubyExtractor
- Inherits:
-
Object
- Object
- Slimcop::RubyExtractor
- Defined in:
- lib/slimcop/ruby_extractor.rb
Overview
Extract codes from Slim source.
Instance Method Summary collapse
- #call ⇒ Array<Hash>
-
#initialize(file_path:, source:) ⇒ RubyExtractor
constructor
A new instance of RubyExtractor.
Constructor Details
#initialize(file_path:, source:) ⇒ RubyExtractor
Returns a new instance of RubyExtractor.
10 11 12 13 |
# File 'lib/slimcop/ruby_extractor.rb', line 10 def initialize(file_path:, source:) @file_path = file_path @source = source end |
Instance Method Details
#call ⇒ Array<Hash>
16 17 18 19 20 21 22 23 24 |
# File 'lib/slimcop/ruby_extractor.rb', line 16 def call ranges.map do |(begin_, end_)| { begin_: begin_, code: @source[begin_...end_], end_: end_ } end end |