Category Notes

I’ve moved…

ajonas.heroku.com Advertisements

Octopress

Follow directions here…   Setting Up Octopress http://octopress.org/docs/setup/ Had one hiccup in my system didn’t have Ruby 1.9.2 which .rvmrc file requires (https://rvm.io//workflow/rvmrc/). I had to go ahead and install it.   Deploying on Heroku: http://octopress.org/docs/deploying/heroku/   That all went fairly well… though I didn’t understand all the intermediate steps. I’ll have to take closer […]

Procs and lambdas

You know how everything in Ruby is an object, well, as it turns out that’s not quite true. Ruby blocks are not objects! So, blocks are not objects, but you can turn them into objects without too much trouble. We do this by wrapping our block in an instance of the Proc class… PROCS: Very standard to pass along a code block […]

=== case equality operator

In a case statement… case number when 5 #some code when 3 #more code else #something else end Behind the scenes 5 is being compared to number with the === operator, so 5 === number, 3 === number, etc   several = Proc.new { |number| number > 3 && number < 8 } none = […]

Rails 1st Lecture

Rails Lecture I – July 2 How the web works: -the requests we send to other servers have headers with info about the request -you get the response with a header and the body -the body is just text and data with HTML -the communication happens over TCP/IP, namely HTTP – the browser renders the […]

Lecture 6 Ruby- Class Methods, Modules, Inheritance, I/O, Private & Public Methods, Rack, Gems, Sinatra, Scrapers

Strategy… #look for nouns to start url- unified resource locator map and collect –> returns the results of the operation–> so it uts it into a new array select when you are trying to match something, cannot collect things conditionally # => library.songs.select{|s| s.name ==song_name} is_a? –> is this an array, this is a validator […]

Enumerables and OO- Class Notes for Lecture 5

(FROM THE VIDEO) diff between each and map (map reduce)- 12min:30 while each will only return to you the array map will return a modified version of the array’s element based on the operation– will save the result in a new array each will simply execute the block another syntax for blocks: do / end […]