Class: FlutterRb::ProjectParser

Inherits:
Object
  • Object
show all
Defined in:
lib/flutter_rb/project/project.rb

Overview

Class to parse and represent a Flutter project.

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ ProjectParser

Initializes a new instance of ProjectParser.

Parameters:

  • path (String)

    The path to the Flutter project.



54
55
56
# File 'lib/flutter_rb/project/project.rb', line 54

def initialize(path)
  @path = path
end

Instance Method Details

#projectProject?

Parses the Flutter project at the given path and returns a Project object.

Returns:

  • (Project, nil)

    A Project object if the project exists and can be parsed, otherwise nil.



61
62
63
# File 'lib/flutter_rb/project/project.rb', line 61

def project
  File.exist?("#{@path}/pubspec.yaml") ? parse_project : nil
end