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.
- #title(title = nil) ⇒ Object
Methods included from Common
Constructor Details
#initialize(name, condition) ⇒ Family
Returns a new instance of Family.
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/train/platforms/family.rb', line 8 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.
6 7 8 |
# File 'lib/train/platforms/family.rb', line 6 def children @children end |
#condition ⇒ Object
Returns the value of attribute condition.
6 7 8 |
# File 'lib/train/platforms/family.rb', line 6 def condition @condition end |
#families ⇒ Object
Returns the value of attribute families.
6 7 8 |
# File 'lib/train/platforms/family.rb', line 6 def families @families end |
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'lib/train/platforms/family.rb', line 6 def name @name end |
Instance Method Details
#title(title = nil) ⇒ Object
20 21 22 23 24 |
# File 'lib/train/platforms/family.rb', line 20 def title(title = nil) return @title if title.nil? @title = title self end |