Sha256: ca44c868a0407bed77630d2fc0e6c12d7a6c9289ed572a83879e7ecbc65320bc

Contents?: true

Size: 248 Bytes

Versions: 1

Compression:

Stored size: 248 Bytes

Contents

# frozen_string_literal: true

require_relative './base'

module Ssz
  class Boolean < Base
    def initialize(bool)
      @bool = bool
    end

    def serialize
      Array(@bool ? 1 : 0).pack("C")
    end

    def size
      1
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ssz-0.1.0 lib/ssz/boolean.rb