Class: String
Instance Method Summary collapse
-
#ljust(number_of_characters) ⇒ Object
REMOVE when RubyMotion adds this.
-
#rjust(number_of_characters) ⇒ Object
REMOVE when RubyMotion adds this.
Instance Method Details
#ljust(number_of_characters) ⇒ Object
REMOVE when RubyMotion adds this
14 15 16 17 18 19 20 21 22 |
# File 'lib/project/ext/string.rb', line 14 def ljust(number_of_characters) if self.length < number_of_characters out = self out << " " * (number_of_characters - self.length) out else self end end |
#rjust(number_of_characters) ⇒ Object
REMOVE when RubyMotion adds this
3 4 5 6 7 8 9 10 11 |
# File 'lib/project/ext/string.rb', line 3 def rjust(number_of_characters) if self.length < number_of_characters out = " " * (number_of_characters - self.length) out << self out else self end end |