Class: String

Inherits:
Object show all
Defined in:
lib/ext/string.rb

Instance Method Summary collapse

Instance Method Details

#color_stringObject

Sets the size for this string, but does not modify the string. Appends 0 to the beginning if original is one in legnth. (Used in Rubydraw::Color#to_i)



5
6
7
8
9
10
11
12
13
# File 'lib/ext/string.rb', line 5

def color_string
  new_str = self[0..1]
  if new_str.size == 1
    result = "0" + new_str
  else
    result = new_str
  end
  result
end