background preloader

Ruby

Facebook Twitter

Learn Web Development with the Ruby on Rails Tutorial.

Rails

Rails Searchable API Doc. Ruby on Rails. Ruby on Rails Documentation. Code School - Rails for Zombies. Code School - TryRuby. Good show, my friend! The join method took that list of reversed lines and put them together into a single string. (Sure, you could have also just used to_s.) Time for a quick review. Exclamation Points. Guess what? At this point, you may want to tinker with the poem a bit more. And now on to something new. String (Ruby 2.0) Str % arg → new_str click to toggle source Format—Uses str as a format specification, and returns the result of applying it to arg. If the format specification contains more than one substitution, then arg must be an Array or Hash containing the values to be substituted. See Kernel::sprintf for details of the format string. static VALUE rb_str_format_m(VALUE str, VALUE arg) { volatile VALUE tmp = rb_check_array_type(arg); if (!

Str * integer → new_str click to toggle source Copy — Returns a new String containing integer copies of the receiver. integer must be greater than or equal to 0. "Ho! Str + other_str → new_str click to toggle source Concatenation—Returns a new String containing other_str concatenated to str. "Hello from " + self.to_s str << integer → str click to toggle source str << obj → str Append—Concatenates the given object to str. A = "hello "a << "world" a.concat(33) string <=> other_string → -1, 0, +1 or nil click to toggle source nil is returned if the two values are incomparable.