Class: Order

Inherits:
Object
  • Object
show all
Defined in:
lib/galaxy/models/race.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(race, password, game, turn) ⇒ Order

Returns a new instance of Order.



97
98
99
100
101
102
103
# File 'lib/galaxy/models/race.rb', line 97

def initialize( race, password, game, turn )
  @race = race
  @password = password
  @game = game
  @turn = turn
  @text = "#order #@game #{@race.name}_#@password turn #@turn\n#end\n"
end

Instance Attribute Details

#raceObject

Returns the value of attribute race.



95
96
97
# File 'lib/galaxy/models/race.rb', line 95

def race
  @race
end

#textObject

Returns the value of attribute text.



95
96
97
# File 'lib/galaxy/models/race.rb', line 95

def text
  @text
end

Instance Method Details

#add_line(line) ⇒ Object



105
106
107
# File 'lib/galaxy/models/race.rb', line 105

def add_line line
  @text[-6] = "\n" + line + "\n"
end

#recalc_orderObject



109
110
111
# File 'lib/galaxy/models/race.rb', line 109

def recalc_order
  puts "Unable to recalculate: method under construction!"
end