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
$ irb | |
>> a | |
NameError: undefined local variable or method `a' for main:Object | |
>> b = b | |
=> nil | |
>> b | |
=> nil |
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
class Faceparty | |
class FacebookParser < HTTParty::Parser | |
def parse | |
super if body != "false" | |
end | |
end | |
include HTTParty | |
parser FacebookParser | |
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
class Foo | |
attr_accessor :bar | |
def initialize(bar) | |
self.bar = bar | |
end | |
end | |
# what I do now... |
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
# Event love! | |
Pinger = | |
ping: -> | |
console.log 'ping!' | |
$(this).trigger('pinged') | |
Ponger = | |
pong: -> | |
console.log 'pong!' |
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 RouteMatcher | |
class NoSubdomain | |
def === (other) | |
other.blank? || SubdomainFu.mirrors.include?(other) | |
end | |
end | |
class Subdomain < NoSubdomain | |
def === (other) |
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 make_sandwiches(however_many) | |
sandwiches = [] | |
however_many.times do | |
sandwiches << make_sandwich { |sandwich| yield sandwich } | |
end | |
sandwiches | |
end | |
def make_sandwich | |
puts "makin a sandwich" |