File: family.rb

package info (click to toggle)
ruby-train 3.2.28-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 1,116 kB
  • sloc: ruby: 9,246; sh: 17; makefile: 8
file content (31 lines) | stat: -rw-r--r-- 622 bytes parent folder | download
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