Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/auser/dslify
Easily add DSL accessors to any class without bothering to mess with the gory details of their implementation
https://github.com/auser/dslify
Last synced: 3 months ago
JSON representation
Easily add DSL accessors to any class without bothering to mess with the gory details of their implementation
- Host: GitHub
- URL: https://github.com/auser/dslify
- Owner: auser
- License: mit
- Created: 2008-12-20T03:04:08.000Z (about 16 years ago)
- Default Branch: master
- Last Pushed: 2009-06-05T01:49:08.000Z (over 15 years ago)
- Last Synced: 2024-04-13T22:57:38.912Z (9 months ago)
- Language: Ruby
- Homepage: http://blog.xnot.org
- Size: 200 KB
- Stars: 14
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.rdoc
- License: LICENSE
Awesome Lists containing this project
README
= dslify
Dslify, born out of a need for improvement on Dslify
Add dsl accessors to any class.
Usage:
class MyClass
include Dslify
dsl_methods :award, :people
end
mc = MyClass.new
mc.award "Tony Award"
mc.people ["Bob", "Frank", "Ben"]
You can set defaults as well:
class MyClass
default_options :award => "Tony Award"
endFinally, if your tree of available accessors runs higher and longer than
just 1 file, for instance, if you use Parenting, you can set forwarders to
forward the query up the chainclass MyClass
forwards_to :parent
end== Copyright
Copyright (c) 2009 Ari Lerner. See LICENSE for details.