Class: Tox::Nospam
Overview
Nospam primitive.
Instance Attribute Summary
Attributes inherited from Binary
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(value) ⇒ Nospam
constructor
A new instance of Nospam.
- #to_i ⇒ Object
Methods inherited from Binary
#==, hex_re, #hex_value=, #inspect, #to_s
Constructor Details
#initialize(value) ⇒ Nospam
Returns a new instance of Nospam.
12 13 14 15 |
# File 'lib/tox/nospam.rb', line 12 def initialize(value) return @value = [value].pack('L').reverse.freeze if value.is_a? Integer super end |
Class Method Details
.bytesize ⇒ Object
8 9 10 |
# File 'lib/tox/nospam.rb', line 8 def self.bytesize 4 end |
Instance Method Details
#to_i ⇒ Object
17 18 19 |
# File 'lib/tox/nospam.rb', line 17 def to_i @to_i ||= value.reverse.unpack('L').first end |