# Public: Various methods useful for performing mathematical operations.
# All methods are module methods and should be called on the Math module.
#
# Examples
#
# Math.square_root(9)
# # => 3
class Math
# Public: Duplicate some text an arbitrary number of times.
#
# text - The String to be duplicated.
# count - The Integer number of times to duplicate the text.
#
# Examples
#
# multiplex('x', 4)
# # => 'xxxx'
#
# multiplex('apple', 2)
# # => 'appleapple'
#
# Returns the duplicated String.
def multiplex(text, count)
text * count
end
end
Produces the following console output (note the missing examples from the multiplex method):
--------------------------------------------------------------------------------
Math
Public: Various methods useful for performing mathematical operations.
All methods are module methods and should be called on the Math module.
Examples
Math.square_root(9)
# => 3
--------------------------------------------------------------------------------
Math#multiplex(text, count)
Public: Duplicate some text an arbitrary number of times.
text - The String to be duplicated.
count - The Integer number of times to duplicate the text.
Examples
Returns the duplicated String.
With HTML as the format the examples are there but the class description is omitted?
<ul>
<li><b>Math#multiplex(text, count)</b><pre>Public: Duplicate some text an arbitrary number of times.
text - The String to be duplicated.
count - The Integer number of times to duplicate the text.
Examples
multiplex('x', 4)
# => 'xxxx'
multiplex('apple', 2)
# => 'appleapple'
Returns the duplicated String.</pre></li></ul>
Using a simple example from the spec:
Produces the following console output (note the missing examples from the
multiplex
method):With HTML as the format the examples are there but the class description is omitted?