Class: BinaryCodec::Hash192
- Inherits:
-
Hash
- Object
- SerializedType
- ComparableSerializedType
- Hash
- BinaryCodec::Hash192
- Defined in:
- lib/binary-codec/types/hash.rb
Class Attribute Summary collapse
-
.width ⇒ Object
readonly
Returns the value of attribute width.
-
.zero_192 ⇒ Object
readonly
Returns the value of attribute zero_192.
Attributes inherited from SerializedType
Instance Method Summary collapse
-
#initialize(bytes = nil) ⇒ Hash192
constructor
A new instance of Hash192.
Methods inherited from Hash
#compare_to, from, from_parser, #nibblet
Methods inherited from ComparableSerializedType
#compare_to, #eq, #gt, #gte, #lt, #lte
Methods inherited from SerializedType
from, from_bytes, from_hex, from_json, from_parser, get_type_by_name, #to_byte_sink, #to_bytes, #to_hex, #to_json, #to_s
Constructor Details
#initialize(bytes = nil) ⇒ Hash192
Returns a new instance of Hash192.
85 86 87 88 |
# File 'lib/binary-codec/types/hash.rb', line 85 def initialize(bytes = nil) bytes = self.class.zero_192 if bytes&.empty? super(bytes, self.class.width) end |
Class Attribute Details
.width ⇒ Object (readonly)
Returns the value of attribute width.
82 83 84 |
# File 'lib/binary-codec/types/hash.rb', line 82 def width @width end |
.zero_192 ⇒ Object (readonly)
Returns the value of attribute zero_192.
82 83 84 |
# File 'lib/binary-codec/types/hash.rb', line 82 def zero_192 @zero_192 end |