This file contains hidden or 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
def jobs | |
Job.where(user_id: self.id) | |
end |
This file contains hidden or 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' | |
# WE NEED TO BE ABLE TO ... AND ... GIVEN ... | |
# WE NEED TO BE ABLE TO add amounts in different currencies AND convert the result GIVEN a set of exchange rates | |
# $5 + 10 CHF = $10 if CHF:USD rate is 2:1 | |
# WE NEED TO BE ABLE TO multiply a number (of shares) with an amount (price per share) AND receive an amount | |
# $5 * 2 = $10 | |
# money rounding, make amount private, equals(), hashCode(), equal null, equal object? | |
class Dollar |
This file contains hidden or 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 Dollar | |
def initialize(amount) | |
@amount = amount | |
end | |
def times(multiplier) | |
Dollar.new(@amount * multiplier) | |
end | |
def equals?(object) |
This file contains hidden or 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
FACTUAL_KEY = #omitted | |
FACTUAL_SECRET_KEY = #omitted | |
LOB_TEST_API_KEY = #omitted | |
require 'factual' | |
require 'lob' | |
factual = Factual.new(FACTUAL_KEY, FACTUAL_SECRET_KEY) | |
hotels = factual.table("hotels-us").limit(20).rows |
This file contains hidden or 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
module Tutorials | |
def the_best_one_out_there | |
"PJ Celis' tutorial on getting to know a code base" | |
end | |
end | |
class RecommendationsController < ApplicationController | |
def tweet_out_the_best | |
recommended_tutorial = Tutorials.the_best_one_out_there | |
Tweeter.send(tweet(recommended_tutorial)) |
OlderNewer