Class: Baron::Train

Inherits:
Object
  • Object
show all
Includes:
Ownable
Defined in:
lib/baron/train.rb

Overview

A train which can be owned by a company

Trains will be run by a company in order to earn money for itself or its shareholders.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Ownable

#owner, #owner=, #validate_owner

Methods included from Transferrable

#owner=, #validate_owner

Constructor Details

#initialize(type) ⇒ Train

Create the train

Examples:

Baron::Train.new(train_type)

Parameters:

  • type (Baron:TrainType)

25
26
27
# File 'lib/baron/train.rb', line 25

def initialize(type)
  @type = type
end

Instance Attribute Details

#typeBaron::TrainType (readonly)

The type of train that this is

Examples:

train.type

Returns:


16
17
18
# File 'lib/baron/train.rb', line 16

def type
  @type
end

Instance Method Details

#face_valueBaron::Money

The face value cost of this train

Examples:

train.face_value

Returns:

See Also:


37
38
39
# File 'lib/baron/train.rb', line 37

def face_value
  type.face_value
end