Module: Hypertemplate::RegistryContainer
- Included in:
- ActionController::Base
- Defined in:
- lib/hypertemplate/hook/rails.rb
Instance Method Summary collapse
Instance Method Details
#hypertemplate_registry ⇒ Object
6 7 8 |
# File 'lib/hypertemplate/hook/rails.rb', line 6 def hypertemplate_registry @hypertemplate || use_hypertemplate end |
#use_hypertemplate(&block) ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/hypertemplate/hook/rails.rb', line 10 def use_hypertemplate(&block) @hypertemplate = ::Hypertemplate::Registry.new if block_given? yield @hypertemplate else @hypertemplate << ::Hypertemplate::Builder::Json @hypertemplate << ::Hypertemplate::Builder::Xml end @hypertemplate end |