Last active
May 23, 2016 15:41
-
-
Save mrb/d176e9d5514f23526aa4d4cd47740140 to your computer and use it in GitHub Desktop.
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 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