Class: Hexdump::FormatString Private
- Inherits:
-
Object
- Object
- Hexdump::FormatString
- Defined in:
- lib/hexdump/format_string.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Direct Known Subclasses
Numeric::Binary, Numeric::CharOrInt, Numeric::Decimal, Numeric::Hexadecimal, Numeric::Octal
Instance Method Summary collapse
-
#%(value) ⇒ String
private
Formats the given value.
-
#initialize(fmt) ⇒ FormatString
constructor
private
Initializes the format string.
-
#to_s ⇒ String
private
Converts the format string back into a String.
Constructor Details
#initialize(fmt) ⇒ FormatString
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initializes the format string.
15 16 17 |
# File 'lib/hexdump/format_string.rb', line 15 def initialize(fmt) @fmt = fmt end |
Instance Method Details
#%(value) ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Formats the given value.
28 29 30 |
# File 'lib/hexdump/format_string.rb', line 28 def %(value) sprintf(@fmt,value) end |
#to_s ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Converts the format string back into a String.
38 39 40 |
# File 'lib/hexdump/format_string.rb', line 38 def to_s @fmt end |