Class: Order
- Inherits:
-
Object
- Object
- Order
- Defined in:
- lib/galaxy/models/race.rb
Instance Attribute Summary collapse
-
#race ⇒ Object
Returns the value of attribute race.
-
#text ⇒ Object
Returns the value of attribute text.
Instance Method Summary collapse
- #add_line(line) ⇒ Object
-
#initialize(race, password, game, turn) ⇒ Order
constructor
A new instance of Order.
- #recalc_order ⇒ Object
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
#race ⇒ Object
Returns the value of attribute race.
95 96 97 |
# File 'lib/galaxy/models/race.rb', line 95 def race @race end |
#text ⇒ Object
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_order ⇒ Object
109 110 111 |
# File 'lib/galaxy/models/race.rb', line 109 def recalc_order puts "Unable to recalculate: method under construction!" end |