Exception: Ruber::World::ProjectFactory::MismatchingNameError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/ruber/world/project_factory.rb

Overview

Exception raised when the name requested for a project file is different for the name contained in the project itself

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (MismatchingNameError) initialize(file, requested_name, actual_name)

A new instance of MismatchingNameError

Parameters:

  • file (String)

    the project file

  • requested_name (String)

    the name requested for the project

  • actual_name (String)

    the project name contained in the project



61
62
63
64
65
66
# File 'lib/ruber/world/project_factory.rb', line 61

def initialize file, requested_name, actual_name
  @file = file
  @requested_name = requested_name
  @actual_name = actual_name
  super "A project associated with #{file} exists, but the corresponding project name is #{actual_name} instead of #{requested_name}"
end

Instance Attribute Details

- (String) actual_name (readonly)

The project name contained in the project file

Returns:

  • (String)

    the project name contained in the project file



54
55
56
# File 'lib/ruber/world/project_factory.rb', line 54

def actual_name
  @actual_name
end

- (String) file (readonly)

The project file

Returns:

  • (String)

    the project file



44
45
46
# File 'lib/ruber/world/project_factory.rb', line 44

def file
  @file
end

- (String) requested_name (readonly)

The requested project name

Returns:

  • (String)

    the requested project name



49
50
51
# File 'lib/ruber/world/project_factory.rb', line 49

def requested_name
  @requested_name
end