lib/ronin/formatting/extensions/binary/integer.rb in ronin-support-0.1.0 vs lib/ronin/formatting/extensions/binary/integer.rb in ronin-support-0.2.0.rc1
- old
+ new
@@ -42,10 +42,12 @@
#
# @example
# 0xff41.bytes(4, :big)
# # => [0, 0, 255, 65]
#
+ # @api public
+ #
def bytes(address_length,endian=:little)
endian = endian.to_sym
buffer = []
case endian
@@ -105,10 +107,12 @@
# 0x41.pack('L')
# # => "A\0\0\0"
#
# @see http://ruby-doc.org/core/classes/Array.html#M002222
#
+ # @api public
+ #
def pack(arch,address_length=nil)
if arch.kind_of?(String)
return [self].pack(arch)
end
@@ -133,9 +137,11 @@
# The hex escaped version of the Integer.
#
# @example
# 42.hex_escape
# # => "\\x2a"
+ #
+ # @api public
#
def hex_escape
"\\x%.2x" % self
end