Class: CityCost

Inherits:
Object show all
Defined in:
lib/models/city_cost.rb

Instance Method Summary collapse

Instance Method Details

#after_initializeObject



6
7
8
# File 'lib/models/city_cost.rb', line 6

def after_initialize
  set_kids if new?
end

#set_kidsObject



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/models/city_cost.rb', line 10

def set_kids
  self.kid_date = rand(65535)
  self.kid_time = rand(65535)
  self.kid_comm = rand(255)
  self.kid_mult = rand(255)
  self.kid_user = String.random_of_length(4)
  self.owner_kid_date = city_pair.kid_date
  self.owner_kid_time = city_pair.kid_time
  self.owner_kid_mult = city_pair.kid_mult
  self.owner_kid_comm = city_pair.kid_comm
  self.owner_kid_user = city_pair.kid_user
end