Class: BCDString

Inherits:
String show all
Includes:
BCD
Defined in:
lib/rdoba/bcd.rb

Constant Summary

Constants inherited from String

String::ByteByByte, String::FirstChar

Instance Method Summary collapse

Methods included from BCD

parse, #to_i

Methods inherited from String

#-, #=~, #__match__, #_rdoba_to_i, #consolize, #fe, #hexdump, #rmatch, #rom, #scanf, #scanf_re, #to_i, #to_re, #to_res

Constructor Details

#initialize(value = nil) ⇒ BCDString

Returns a new instance of BCDString.



51
52
53
54
55
# File 'lib/rdoba/bcd.rb', line 51

def initialize value = nil
    if value.is_a? Numeric
self.replace BCD.parse( value )
    else
super value.to_s; end; end