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

#initialize(file, requested_name, actual_name) ⇒ MismatchingNameError

Returns 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

#actual_nameString (readonly)

Returns 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

#fileString (readonly)

Returns the project file.

Returns:

  • (String)

    the project file



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

def file
  @file
end

#requested_nameString (readonly)

Returns 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