Method: Train::Platforms.name

Defined in:
lib/train/platforms.rb

.name(name, condition = {}) ⇒ Object

Create or update a platform

Returns:

  • Train::Platform



32
33
34
35
36
37
38
39
40
41
42
# File 'lib/train/platforms.rb', line 32

def self.name(name, condition = {})
  # Check the list to see if one is already created
  plat = list[name]
  unless plat.nil?
    # Pass the condition incase we are adding a family relationship
    plat.condition = condition unless condition.nil?
    return plat
  end

  Train::Platforms::Platform.new(name, condition)
end