Class: GemfileParser::AstConverter

Inherits:
Object
  • Object
show all
Defined in:
lib/gemfile_parser/ast_converter.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file_path:, string:) ⇒ AstConverter

Returns a new instance of AstConverter.



22
23
24
25
26
27
28
# File 'lib/gemfile_parser/ast_converter.rb', line 22

def initialize(
  file_path:,
  string:
)
  @file_path = file_path
  @string = string
end

Class Method Details

.call(file_path: nil, string: nil) ⇒ Array<String>

Parameters:

  • file_path (String) (defaults to: nil)
  • string (String) (defaults to: nil)

Returns:

  • (Array<String>)


11
12
13
14
15
16
17
18
19
# File 'lib/gemfile_parser/ast_converter.rb', line 11

def call(
  file_path: nil,
  string: nil
)
  new(
    file_path: file_path,
    string: string
  ).call
end

Instance Method Details

#callObject



30
31
32
# File 'lib/gemfile_parser/ast_converter.rb', line 30

def call
  to_ast
end