Class: String
Instance Method Summary collapse
- #add_period ⇒ Object
- #ends_with?(a) ⇒ Boolean
- #in?(a) ⇒ Boolean
- #print ⇒ Object
- #puts ⇒ Object
- #uppercase ⇒ Object
Instance Method Details
#add_period ⇒ Object
72 73 74 75 76 77 |
# File 'lib/string__.rb', line 72 def add_period if self[-1] == '.' self else "#{self}."; end end |
#ends_with?(a) ⇒ Boolean
68 69 70 |
# File 'lib/string__.rb', line 68 def ends_with?(a) end_with? a end |
#in?(a) ⇒ Boolean
64 65 66 |
# File 'lib/string__.rb', line 64 def in?(a) a.include? self end |
#print ⇒ Object
59 60 61 62 |
# File 'lib/string__.rb', line 59 def print Kernel.print self self end |
#puts ⇒ Object
54 55 56 57 |
# File 'lib/string__.rb', line 54 def puts Kernel.puts self self end |
#uppercase ⇒ Object
96 97 98 99 100 |
# File 'lib/string__.rb', line 96 def uppercase return '' if self[0].nil? self[0].capitalize + slice(1, length) end |