Sha256: 3421587ffd15cc3e2d33a36c3eb1e59cfb283fdfd6d67257c400e6a35f4aa24a

Contents?: true

Size: 388 Bytes

Versions: 13

Compression:

Stored size: 388 Bytes

Contents

# @private
module BinData
  class Bool < Primitive
    uint8 :_value

    def get
      (self._value || 0) > 0
    end

    def set(value)
      self._value = value ? 1 : 0
    end
  end

  class BoolBit1 < Primitive
    bit1le :_value

    def get
      (self._value || 0) > 0
    end

    def set(value)
      self._value = value ? 1 : 0
    end

    def !
      !get
    end
  end
end

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
lifx-lan-0.2.1 lib/bindata_ext/bool.rb
lifx-lan-0.2.0 lib/bindata_ext/bool.rb
lifx-lan-0.1.0 lib/bindata_ext/bool.rb
lifx-0.4.11 lib/bindata_ext/bool.rb
lifx-0.4.10 lib/bindata_ext/bool.rb
lifx-0.4.8 lib/bindata_ext/bool.rb
lifx-0.4.7 lib/bindata_ext/bool.rb
lifx-0.4.6.1 lib/bindata_ext/bool.rb
lifx-0.4.5 lib/bindata_ext/bool.rb
lifx-0.4.4 lib/bindata_ext/bool.rb
lifx-0.4.3 lib/bindata_ext/bool.rb
lifx-0.4.2 lib/bindata_ext/bool.rb
lifx-0.4.1 lib/bindata_ext/bool.rb