Module: Hexdump
- Defined in:
- lib/hexdump/hexdump.rb,
lib/hexdump/dumper.rb,
lib/hexdump/version.rb
Overview
Provides the Hexdump.dump method and can add hexdumping to other classes by including the Hexdump module.
class AbstractData
include Hexdump
def each_byte
# ...
end
end
data = AbstractData.new
data.hexdump
Defined Under Namespace
Classes: Dumper
Constant Summary collapse
- VERSION =
hexdump version
'0.2.3'
Class Method Summary collapse
-
.dump(data, options = {}) {|index, numeric, printable| ... } ⇒ nil
Hexdumps the given data.
Instance Method Summary collapse
-
#hexdump(options = {}, &block) ⇒ Object
Hexdumps the object.
Class Method Details
.dump(data, options = {}) {|index, numeric, printable| ... } ⇒ nil
Hexdumps the given data.
71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/hexdump/hexdump.rb', line 71 def Hexdump.dump(data,={},&block) output = (.delete(:output) || STDOUT) dumper = Dumper.new() if block dumper.each(data,&block) else dumper.dump(data,output) end return nil end |