Class: Tone
- Inherits:
-
Object
- Object
- Tone
- Defined in:
- lib/classes.rb
Class Method Summary collapse
Instance Method Summary collapse
- #_dump(*_ignored) ⇒ Object
-
#initialize(bytes) ⇒ Tone
constructor
A new instance of Tone.
Constructor Details
#initialize(bytes) ⇒ Tone
Returns a new instance of Tone.
51 52 53 |
# File 'lib/classes.rb', line 51 def initialize(bytes) @r, @g, @b, @a = *bytes.unpack('D4') end |
Class Method Details
._load(bytes) ⇒ Object
59 60 61 |
# File 'lib/classes.rb', line 59 def self._load(bytes) new(bytes) end |
Instance Method Details
#_dump(*_ignored) ⇒ Object
55 56 57 |
# File 'lib/classes.rb', line 55 def _dump(*_ignored) [@r, @g, @b, @a].pack('D4') end |