Skip to content

Instantly share code, notes, and snippets.

@pschyska
Created March 10, 2012 13:46
Show Gist options
  • Save pschyska/2011450 to your computer and use it in GitHub Desktop.
Save pschyska/2011450 to your computer and use it in GitHub Desktop.
class Base
attr_accessor_with_default :config, OrderedOptions.new
def initialize passed, parent
# how do we handle class_level default config and delegatestodsl config in a way that it's overridable by the user?
@config.merge! passed
end
def js_config
@config.reject {
# reject server_sider_config
}.to_nifty_json
end
class CustomComponent < Base
title "Blah"
def initialize passed, parent
@config.model = "Foo'
super
apply_persistent_config
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment