Skip to content

Instantly share code, notes, and snippets.

@hassox
Created November 9, 2009 08:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hassox/229788 to your computer and use it in GitHub Desktop.
Save hassox/229788 to your computer and use it in GitHub Desktop.
##### Configuration Example
MyStack.configuration do
default :page_title, "Awesome!"
default :home_url, :home
default :use_live_resource lambda{ _use_live_resource? }
def _use_live_resource?
Pancake.env != "development"
end
end
MyStack.configuration.page_title #=> "Awesome!"
MyStack.configuration.page_title = "Cool!"
MyStack.configuration.page_title #=> "Cool!"
MyStack.configuration.some_unkown_value #=> nil
MyStack.configuraiton.some_unknown_value = "foo"
MyStack.configuration.some_unknown_value #=> "foo"
class ChildStack < MyStack; end
ChildStack.configuration.page_title #=> "Awesome!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment