1. Technology

Articles related to to_s

Data Visualization - Ruby - About.com
We're going to hijack (or, more accurately, implement) the Node#to_s method. It should iterate over the tree, starting at itself (so if we want the whole tree, we call  ...
http://ruby.about.com/od/textadventure/ss/Data-Visualization.htm
Getting and Printing Strings - Ruby - About.com
Aug 17, 2011 ... If the object you pass to puts is not a string, the puts method will attempt to call to_s on that object. For example, if I were to pass a number to ...
http://ruby.about.com/od/strings/a/Getting-And-Printing-Strings.htm
Method for Mapping the Values of an Array - Ruby - About.com
So, if we have an array of numbers but we want strings, we can do something like this. [ 1, 2, 3, 4 ].map(&:to_s) # This will produce the array [ "1", "2", "3", "4" ].
http://ruby.about.com/od/rubysbasicfeatures/ss/Mapping-Arrays.htm
Symbols - Ruby - About.com
To test for a symbol without creating it, you could convert all the symbols to strings (using :some_symbol.to_s and test for the identifying strings. There is no real ...
http://ruby.about.com/od/rubysbasicfeatures/ss/Symbols.htm
Simple Programming under Linux - About.com
print "You entered " + a.length.to_s + " entries.\n\n" for i in 0...a.length do print " Entry " + (i+1).to_s + ": "+ a[i] + "\n" end. I save my ruby script to file "myprogram".
http://linux.about.com/library/bl/open/newbie/blnewbie7.2ruby.htm
Using the Input / Output Methods in Ruby - About.com
For objects of all other types, puts will first call the object's to_s method which attempts to convert the object to a string, then prints the result of to_s followed by a ...
http://ruby.about.com/od/rubyfeatures/a/io.htm
Cryptographic Hashes in Ruby - About.com
Whenever you want the hash, you can read it from the hexdigest method or simply from its to_s method. #!/usr/bin/env ruby # Computes the SHA1 hash of any ...
http://ruby.about.com/od/advancedruby/ss/Cryptographic-Hashes-In-Ruby.htm
Split and Join - Using Strings in Ruby - About.com
Using the index operator is ideal when you know the location of the portion of the string you want to change. However, it's rare that you'll know the location, ...
http://ruby.about.com/od/rubyfeatures/ss/strings_4.htm
Part 3: Implementing - Ruby - About.com
def to_param if self.desc.nil? b36_id else "#{b36_id}/#{self.desc}" end end def b36_id self.id.to_i.to_s(36) end end. The first line is the attr_accessible line that ...
http://ruby.about.com/od/rubyonrails/ss/Rails-Url-Shortener-Part-3.htm
Block Parameters and Yielding - Ruby - About.com
... implicit Proc object ret = yield puts %Q{The block yielded "#{ret.to_s}"} end yield_and_print{ 10 } yield_and_print{ "Hello" } yield_and_print do (10 + 20) / 3 end ...
http://ruby.about.com/od/beginningruby/a/Block-Parameters-And-Yielding.htm
1  |  2  |  3      Next

©2014 About.com. All rights reserved.