1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
# encoding: utf-8
module Train::Platforms
class Family
include Train::Platforms::Common
attr_accessor :children, :condition, :families, :name
def initialize(name, condition)
@name = name
@condition = condition
@families = {}
@children = {}
@detect = nil
@title = "#{name.to_s.capitalize} Family"
# add itself to the families list
Train::Platforms.families[@name.to_s] = self
end
def title(title = nil)
return @title if title.nil?
@title = title
self
end
def inspect
"%p[%s]" % [self.class, name]
end
end
end
|