Last active
December 17, 2015 23:49
-
-
Save 1dolinski/5691941 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
| module TestHelper | |
| def person(name ="Sarah", &block) | |
| Person.new(self, name, block) | |
| end | |
| end | |
| class Person < Struct.new(:view, :age, :callback) | |
| delegate :content_tag, to: :view | |
| # a block is an argument for the method which is called in the view | |
| # person @names do |name| | |
| # .. ... | |
| # end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment