Skip to content

Instantly share code, notes, and snippets.

@djsun
Created July 7, 2010 21:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save djsun/467341 to your computer and use it in GitHub Desktop.
Save djsun/467341 to your computer and use it in GitHub Desktop.
class Puller
def initialize(handler)
@handler = handler
end
def run
@handler.organization("DOE")
@handler.organization("NASA")
@handler.source("California Earthquakes")
@handler.source("Hawaii Earthquakes")
@handler.source("OMB Budget Estimates")
end
end
# the internals of the importer framework
class Handler
def initialize
puts "Handler initialized"
end
def source(x)
puts "Source found : #{x.inspect}"
end
def organization(x)
puts "Organization found : #{x.inspect}"
end
end
handler = Handler.new
puller = Puller.new(handler)
puller.run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment