Class: AxTags::TagLibrary
- Inherits:
-
Object
- Object
- AxTags::TagLibrary
- Defined in:
- lib/axtags/tag_library.rb
Class Method Summary collapse
- .build_tags {|context| ... } ⇒ Object
- .context ⇒ Object
- .parse(document, options = {}) ⇒ Object
- .parser ⇒ Object
- .tag(name, options = {}, &block) ⇒ Object
Class Method Details
.build_tags {|context| ... } ⇒ Object
57 58 59 |
# File 'lib/axtags/tag_library.rb', line 57 def self.(&block) yield context end |
.context ⇒ Object
42 43 44 |
# File 'lib/axtags/tag_library.rb', line 42 def self.context @@context ||= AxContext.new end |
.parse(document, options = {}) ⇒ Object
50 51 52 53 54 55 |
# File 'lib/axtags/tag_library.rb', line 50 def self.parse(document, ={}) if locals = .delete(:locals) locals.each {|arg, value| context.globals.send("#{arg}=", value) } end parser.parse(document) end |
.parser ⇒ Object
46 47 48 |
# File 'lib/axtags/tag_library.rb', line 46 def self.parser @@parser ||= AxParser.new(context, :tag_prefix=>"ax") end |
.tag(name, options = {}, &block) ⇒ Object
61 62 63 64 65 |
# File 'lib/axtags/tag_library.rb', line 61 def self.tag(name, ={}, &block) do |c| c.define_tag(name, , &block) end end |