Sha256: cc02914084c21ca285f6e9841e19bace9ae22d4d3f7c0b05f835e570e834b608

Contents?: true

Size: 341 Bytes

Versions: 9

Compression:

Stored size: 341 Bytes

Contents

require 'bindata/base_primitive'

class ExampleSingle < BinData::BasePrimitive
  def self.io_with_value(val)
    BinData::IO.new([val].pack("V"))
  end

  private

  def value_to_binary_string(val)
    [val].pack("V")
  end

  def read_and_return_value(io)
    io.readbytes(4).unpack("V").at(0)
  end

  def sensible_default
    0
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
jbangert-bindata-1.5.0 spec/example.rb
bindata-1.5.1 spec/example.rb
bindata-1.5.0 spec/example.rb
bindata-1.4.5 spec/example.rb
bindata-1.4.4 spec/example.rb
bindata-1.4.3 spec/example.rb
bindata-1.4.2 spec/example.rb
bindata-1.4.1 spec/example.rb
bindata-1.4.0 spec/example.rb