Class: RubyZero::Core::Device
- Inherits:
-
Object
- Object
- RubyZero::Core::Device
- Defined in:
- lib/rubyzero/core/device.rb
Instance Attribute Summary collapse
-
#caluculator ⇒ Object
readonly
Returns the value of attribute caluculator.
-
#identifier ⇒ Object
readonly
Returns the value of attribute identifier.
Instance Method Summary collapse
-
#initialize(identifier) ⇒ Device
constructor
A new instance of Device.
- #xmo ⇒ Object
Constructor Details
#initialize(identifier) ⇒ Device
Returns a new instance of Device.
4 5 6 7 8 9 10 11 12 |
# File 'lib/rubyzero/core/device.rb', line 4 def initialize(identifier) sym = identifier.to_sym if sym == :cpu @caluculator = Numo @identifier = sym else raise RubyZero::Core::Exceptions::DeviceNotSupported, "Device #{identifier} is not supported." end end |
Instance Attribute Details
#caluculator ⇒ Object (readonly)
Returns the value of attribute caluculator.
3 4 5 |
# File 'lib/rubyzero/core/device.rb', line 3 def caluculator @caluculator end |
#identifier ⇒ Object (readonly)
Returns the value of attribute identifier.
3 4 5 |
# File 'lib/rubyzero/core/device.rb', line 3 def identifier @identifier end |
Instance Method Details
#xmo ⇒ Object
13 14 15 16 17 |
# File 'lib/rubyzero/core/device.rb', line 13 def xmo if @identifier == :cpu return Numo end end |