Skip to content

Instantly share code, notes, and snippets.

@tizoc
Created October 20, 2010 21:15
Show Gist options
  • Save tizoc/637340 to your computer and use it in GitHub Desktop.
Save tizoc/637340 to your computer and use it in GitHub Desktop.
class Widget
include Utils
class << self
attr_accessor :needs_multipart_form, :is_hidden
end
@needs_multipart_form = false
@is_hidden = false
def self.inherited(c)
super(c)
c.is_hidden = is_hidden
c.needs_multipart_form = needs_multipart_form
end
attr_reader :attrs
def initialize(attrs=nil)
@attrs = attrs.nil? ? {} : attrs.dup
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment