rubyit.wordpress.com
Ruby and inject | Ruby It!
https://rubyit.wordpress.com/2011/07/26/ruby-inject
July 26, 2011. One of the interesting features of Ruby is the fact that it can utilize some simple functional programming style methods to handle data manipulation. One of these methods is the inject. Method. This method is quoted as providing the following functionality:. Combines all elements of enum by applying a binary operation, specified by a block or a symbol that names a method or operator. The actual signature looks like this:. Puts [1,2,3].inject(: ). Also allows you to set a starting value to ...
rubyit.wordpress.com
Ruby and ARGF | Ruby It!
https://rubyit.wordpress.com/2011/07/25/ruby-and-argf
Basic REST Server With Webrick. July 25, 2011. One of the hidden gems (pun completely intended) of Ruby is the ability to work with a list of files given as command line arguments, or passed in through STDIN redirection. This can be achieved through the use of the ARGF. Class Interestingly enough it does have a method to get command line arguments as an array:. Ruby argf.rb -m test -t something LICENSE README [-m, test, -t, something, LICENSE, README]. ARGFeach { line puts line }. Also mixing files and.
rubyit.wordpress.com
July | 2011 | Ruby It!
https://rubyit.wordpress.com/2011/07
July 26, 2011. One of the interesting features of Ruby is the fact that it can utilize some simple functional programming style methods to handle data manipulation. One of these methods is the inject. Method. This method is quoted as providing the following functionality:. Combines all elements of enum by applying a binary operation, specified by a block or a symbol that names a method or operator. The actual signature looks like this:. July 25, 2011. ARGFeach { line puts line }. Can also be used as well:.
rubyit.wordpress.com
Basic REST Server With Webrick | Ruby It!
https://rubyit.wordpress.com/2011/07/25/basic-rest-server-with-webrick
Basic REST Server With Webrick. July 25, 2011. ONTERIA] gem install json. First off a simple HTTP server is required. Webrick provides just that. I borrowed a code snippet from Gnome’s Guide to WEBrick. A highly recommended read for those who wish to look more into using Webrick. The base code gives this:. Require 'webrick' include WEBrick def start webrick(config = {}) config.update(:Port = 9955) server = HTTPServer.new(config) yield server if block given? Which has the following HTML code:. Class RestS...
SOCIAL ENGAGEMENT