Class: Train::Platforms::Family
- Inherits:
-
Object
- Object
- Train::Platforms::Family
- Includes:
- Common
- Defined in:
- lib/train/platforms/family.rb
Instance Attribute Summary collapse
-
#children ⇒ Object
Returns the value of attribute children.
-
#condition ⇒ Object
Returns the value of attribute condition.
-
#families ⇒ Object
Returns the value of attribute families.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, condition) ⇒ Family
constructor
A new instance of Family.
- #inspect ⇒ Object
- #title(title = nil) ⇒ Object
Methods included from Common
Constructor Details
#initialize(name, condition) ⇒ Family
Returns a new instance of Family.
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/train/platforms/family.rb', line 6 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 |
Instance Attribute Details
#children ⇒ Object
Returns the value of attribute children.
4 5 6 |
# File 'lib/train/platforms/family.rb', line 4 def children @children end |
#condition ⇒ Object
Returns the value of attribute condition.
4 5 6 |
# File 'lib/train/platforms/family.rb', line 4 def condition @condition end |
#families ⇒ Object
Returns the value of attribute families.
4 5 6 |
# File 'lib/train/platforms/family.rb', line 4 def families @families end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/train/platforms/family.rb', line 4 def name @name end |
Instance Method Details
#inspect ⇒ Object
25 26 27 |
# File 'lib/train/platforms/family.rb', line 25 def inspect "%p[%s]" % [self.class, name] end |
#title(title = nil) ⇒ Object
18 19 20 21 22 23 |
# File 'lib/train/platforms/family.rb', line 18 def title(title = nil) return @title if title.nil? @title = title self end |