Skip to content

Instantly share code, notes, and snippets.

@mrb
Last active May 23, 2016 15:41
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 mrb/d176e9d5514f23526aa4d4cd47740140 to your computer and use it in GitHub Desktop.
Save mrb/d176e9d5514f23526aa4d4cd47740140 to your computer and use it in GitHub Desktop.
class ShoppingList
attr_accessor :items
def initialize(items)
@items = items
end
# Expose private binding() method.
def get_binding
binding()
end
end
list = ShoppingList.new(items)
renderer = ERB.new(template)
puts output = renderer.result(list.get_binding)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment