Created
October 14, 2008 12:18
-
-
Save trek/16705 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 PhotoBox | |
| attr_accessor :element, :images | |
| def initialize(element) | |
| # associate an element with this object | |
| self.element = Element.new(element) | |
| # give it a class | |
| self.element.add_class('active') | |
| # find subelemts and store them | |
| self.images = self.element['.images'] | |
| end | |
| end | |
| Document.ready? do | |
| Document['.photo.box'].each do |box| | |
| PhotoBox.new(box) | |
| end | |
| end |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hm.