This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SalesForce | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
puts "SalesForce Handler" | |
puts "SalesForce AXID found" | |
env[:axids] << "AXID01234567890" | |
env[:salesforce] = {customer: {}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'minitest/autorun' | |
class Hash | |
def method_missing( symbol, *args ) | |
if symbol.to_s.start_with?('_') | |
if symbol.to_s.end_with?('=') | |
key = symbol.to_s.sub('_', '').chop | |
if self.has_key?(key.to_sym) | |
self[key.to_sym] = args.first | |
elsif self.has_key?(key) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Write a directory class which will manage a phone directory for a company. | |
def directory_lookup(directory, input) | |
r = /\A#{input}/ | |
d = directory.dup.keep_if {|name| name_to_num(name.split.last).match(r) } | |
if d.empty? | |
e = directory.dup.map { |name| name_to_num(name.split.last).chr} | |
e.keep_if {|n| n > input.chr }.first | |
return directory_lookup(directory, e) unless e.empty? | |
directory.last |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rails new | |
cd | |
git init | |
git commit -a -m "Initial Commit" | |
git co -b setup | |
-look at .gitignore | |
-change secret_token.rb | |
Gemfile | |
bundle install --without production | |
rails g rspec:install |