Skip to content

Instantly share code, notes, and snippets.

@trek
Created October 14, 2008 12:18
Show Gist options
  • Select an option

  • Save trek/16705 to your computer and use it in GitHub Desktop.

Select an option

Save trek/16705 to your computer and use it in GitHub Desktop.
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
@trek
Copy link
Copy Markdown
Author

trek commented Aug 29, 2012

Hm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment