This class will:
- Convert all keys of the given hash into symbols.
- Remove nil elements, empty strings, empty hashes and empty arrays, from the hash itself and it's child elements.
class HashSanitizer
require 'benchmark/ips' | |
class A | |
def sum | |
1 + 1 | |
end | |
end | |
class B | |
def sum |
#Heroku, Ruby on Rails and PhantomJS
In this post, I’m going to show you how to modify an existing Ruby on Rails app running on Heroku’s Cedar stack to use PhantomJS for screen scraping. If you’ve never heard of PhantomJS, it’s a command-line WebKit-based browser (that supports JavaScript, cookies, etc.).
Let’s get started. This is a high-level overview of the required steps:
###1. Prerequisites:
You must have the following gems installed:
###2. Create new HAML files
Test the changes: (no files created)