Class: Calypso::Hardware

Inherits:
Object
  • Object
show all
Defined in:
lib/calypso/hardware.rb

Overview

Calypso hardware model.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, name, cpu) ⇒ Hardware

Create a new Calypso::Hardware object.

Parameters:

  • id (String)

    Hardware ID.

  • name (String)

    Hardware name.

  • cpu (String)

    CPU name (or MCU for the matter of it).



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

#cpuString (readonly)

Returns CPU name.

Returns:

  • (String)

    CPU name.



28
29
30
# File 'lib/calypso/hardware.rb', line 28

def cpu
  @cpu
end

#idString (readonly)

Returns Hardware ID.

Returns:

  • (String)

    Hardware ID.



24
25
26
# File 'lib/calypso/hardware.rb', line 24

def id
  @id
end

#nameString (readonly)

Returns Hardware name.

Returns:

  • (String)

    Hardware name.



26
27
28
# File 'lib/calypso/hardware.rb', line 26

def name
  @name
end

#testsArray (readonly)

Returns An array of Calypso::UnitTest.

Returns:

  • (Array)

    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.

Parameters:

Returns:

  • (Array)

    The new array of [Calypso::UnitTest].



48
49
50
# File 'lib/calypso/hardware.rb', line 48

def add_test(test)
  @tests.push test
end