Class: Tone

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

Class Method Summary collapse

Instance Method Summary collapse

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