Class: TextAssetContext
- Inherits:
-
Radius::Context
- Object
- Radius::Context
- TextAssetContext
- Defined in:
- app/models/text_asset_context.rb
Instance Method Summary collapse
-
#initialize(text_asset) ⇒ TextAssetContext
constructor
A new instance of TextAssetContext.
- #render_tag(name, attributes = {}, &block) ⇒ Object
- #tag_missing(name, attributes = {}, &block) ⇒ Object
Constructor Details
#initialize(text_asset) ⇒ TextAssetContext
Returns a new instance of TextAssetContext.
3 4 5 6 7 8 9 |
# File 'app/models/text_asset_context.rb', line 3 def initialize(text_asset) super() globals.text_asset = text_asset text_asset..each do |name| define_tag(name) { |tag_binding| text_asset.render_tag(name, tag_binding) } end end |
Instance Method Details
#render_tag(name, attributes = {}, &block) ⇒ Object
12 13 14 15 16 17 18 |
# File 'app/models/text_asset_context.rb', line 12 def render_tag(name, attributes = {}, &block) super rescue Exception => e raise e if raise_errors? @tag_binding_stack.pop unless @tag_binding_stack.last == binding e. end |
#tag_missing(name, attributes = {}, &block) ⇒ Object
21 22 23 24 25 |
# File 'app/models/text_asset_context.rb', line 21 def tag_missing(name, attributes = {}, &block) super rescue Radius::UndefinedTagError => e raise StandardTags::TagError.new(e.) end |