Sha256: f46db17d4ff8bc1a601e0d55e54457aacbbafc1751ab3031a44f35b928329e4d

Contents?: true

Size: 438 Bytes

Versions: 25

Compression:

Stored size: 438 Bytes

Contents

module Etherlite::Types
  class Base
    def signature
      raise NotImplementedError, 'signature must be implemented by base type'
    end

    def size
      nil
    end

    def fixed?
      !size.nil?
    end

    def dynamic?
      size.nil?
    end

    def encode(_value)
      raise NotImplementedError, 'encode must be implemented by base type'
    end

    def decode(_connection, _value)
      '0x' + _value
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
etherlite-0.1.4 lib/etherlite/types/base.rb
etherlite-0.1.3 lib/etherlite/types/base.rb
etherlite-0.1.2 lib/etherlite/types/base.rb
etherlite-0.1.1 lib/etherlite/types/base.rb
etherlite-0.1.0 lib/etherlite/types/base.rb