Module: Bldr
- Defined in:
- lib/bldr.rb,
lib/bldr/node.rb,
lib/bldr/railtie.rb,
lib/bldr/version.rb,
lib/bldr/template.rb
Defined Under Namespace
Classes: Node, Railtie, Template
Constant Summary collapse
- VERSION =
'1.0.1'
Class Method Summary collapse
-
.handler(klass, &block) ⇒ Object
Define a custom handler.
- .handlers ⇒ Object
- .json_encoder=(encoder) ⇒ Object
Class Method Details
.handler(klass, &block) ⇒ Object
Define a custom handler.
30 31 32 33 34 35 |
# File 'lib/bldr.rb', line 30 def handler(klass,&block) raise(ArgumentError, "You must pass a Proc") if block.nil? raise(ArgumentError, "You must pass only one argument to the Proc") unless block.arity == 1 handlers[klass] = block end |
.handlers ⇒ Object
37 38 39 |
# File 'lib/bldr.rb', line 37 def handlers @handlers ||= {} end |
.json_encoder=(encoder) ⇒ Object
17 18 19 |
# File 'lib/bldr.rb', line 17 def json_encoder=(encoder) MultiJson.engine = encoder end |