Class: EacRubyUtils::ByteArray
- Defined in:
- lib/eac_ruby_utils/byte_array.rb
Instance Method Summary collapse
- #<<(value) ⇒ Object
-
#initialize(values = []) ⇒ ByteArray
constructor
A new instance of ByteArray.
- #push(value) ⇒ EacRubyUtils::Byte
- #to_int_array ⇒ Array<Integer>
Constructor Details
#initialize(values = []) ⇒ ByteArray
Returns a new instance of ByteArray.
11 12 13 |
# File 'lib/eac_ruby_utils/byte_array.rb', line 11 def initialize(values = []) values.each { |value| push(value) } end |
Instance Method Details
#<<(value) ⇒ Object
15 16 17 |
# File 'lib/eac_ruby_utils/byte_array.rb', line 15 def <<(value) push(value) end |
#push(value) ⇒ EacRubyUtils::Byte
21 22 23 |
# File 'lib/eac_ruby_utils/byte_array.rb', line 21 def push(value) values_array.push(::EacRubyUtils::Byte.assert(value)) end |
#to_int_array ⇒ Array<Integer>
26 27 28 |
# File 'lib/eac_ruby_utils/byte_array.rb', line 26 def to_int_array values_array.map(&:to_i) end |