Class: SpecFileGenerator::KlassExtractor
- Defined in:
- lib/spec_file_generator/klass_extractor.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(source_file) ⇒ KlassExtractor
constructor
A new instance of KlassExtractor.
Methods inherited from Service
Constructor Details
#initialize(source_file) ⇒ KlassExtractor
Returns a new instance of KlassExtractor.
7 8 9 |
# File 'lib/spec_file_generator/klass_extractor.rb', line 7 def initialize(source_file) @source_file = source_file end |
Instance Method Details
#call ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/spec_file_generator/klass_extractor.rb', line 11 def call ensure_source_file_exist! @module_acc = [] @spec_name = nil look_for_class(ast) return @spec_name unless @spec_name.nil? raise ClassDeclarationMissingError, "Please check content of source file (#{@source_file}). " \ "Class declaration must present in order to generate spec file." end |