Class: Calypso::Hardware
- Inherits:
-
Object
- Object
- Calypso::Hardware
- Defined in:
- lib/calypso/hardware.rb
Overview
Calypso hardware model.
Instance Attribute Summary collapse
-
#cpu ⇒ String
readonly
CPU name.
-
#id ⇒ String
readonly
Hardware ID.
-
#name ⇒ String
readonly
Hardware name.
-
#tests ⇒ Array
readonly
An array of Calypso::UnitTest.
Instance Method Summary collapse
-
#add_test(test) ⇒ Array
Add a new test.
-
#initialize(id, name, cpu) ⇒ Hardware
constructor
Create a new Calypso::Hardware object.
Constructor Details
#initialize(id, name, cpu) ⇒ Hardware
Create a new Calypso::Hardware object.
37 38 39 40 41 42 |
# File 'lib/calypso/hardware.rb', line 37 def initialize(id, name, cpu) @id = id @name = name @cpu = cpu @tests = [] end |
Instance Attribute Details
#cpu ⇒ String (readonly)
Returns CPU name.
28 29 30 |
# File 'lib/calypso/hardware.rb', line 28 def cpu @cpu end |
#id ⇒ String (readonly)
Returns Hardware ID.
24 25 26 |
# File 'lib/calypso/hardware.rb', line 24 def id @id end |
#name ⇒ String (readonly)
Returns Hardware name.
26 27 28 |
# File 'lib/calypso/hardware.rb', line 26 def name @name end |
#tests ⇒ Array (readonly)
Returns An array of Calypso::UnitTest.
30 31 32 |
# File 'lib/calypso/hardware.rb', line 30 def tests @tests end |
Instance Method Details
#add_test(test) ⇒ Array
Add a new test.
48 49 50 |
# File 'lib/calypso/hardware.rb', line 48 def add_test(test) @tests.push test end |