Skip to content

Instantly share code, notes, and snippets.

David Waller dwaller

  • Yammer (Microsoft)
  • Seattle, WA, USA
Block or report user

Report or block dwaller

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View active_record_mimic.rb
require 'model_attribute'
module ActiveRecordMimic
def self.included(base)
base.instance_eval do
unless (class << base; self; end).ancestors.include?(ModelAttribute)
raise "ActiveRecordMimic aliases ModelAttribute methods so must be included after extending ModelAttribute"
end
alias_method :[], :read_attribute
@dwaller
dwaller / bottles.rb
Created Jul 2, 2014
SPA 2014 exercise
View bottles.rb
class Bottles
def song
verses(99, 0)
end
def verses(upper_bound, lower_bound)
upper_bound.downto(lower_bound).map { |i| verse(i) }.join("\n")
end
You can’t perform that action at this time.