Created
October 14, 2008 03:50
-
-
Save trek/16664 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 Thingie | |
| attr_accessor :element | |
| def initialize(element) | |
| self.element = Element.new(element) | |
| # with a block | |
| self.element.respond_to :click do | |
| self.element.hide | |
| ... other stuff ... | |
| end | |
| # or with a referenced method | |
| self.element.respond_to :double_click, :with => :add_to_cart | |
| end | |
| def add_to_cart | |
| ... code ... | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment