Class: Xml::Kit::Template
- Inherits:
-
Object
- Object
- Xml::Kit::Template
- Defined in:
- lib/xml/kit/template.rb
Constant Summary collapse
- TEMPLATES_DIR =
Pathname.new(File.join(__dir__, 'templates/'))
Instance Attribute Summary collapse
-
#target ⇒ Object
readonly
Returns the value of attribute target.
Instance Method Summary collapse
-
#initialize(target) ⇒ Template
constructor
A new instance of Template.
-
#to_xml(options = {}) ⇒ Object
Returns the compiled template as a [String].
Constructor Details
#initialize(target) ⇒ Template
Returns a new instance of Template.
10 11 12 |
# File 'lib/xml/kit/template.rb', line 10 def initialize(target) @target = target end |
Instance Attribute Details
#target ⇒ Object (readonly)
Returns the value of attribute target.
8 9 10 |
# File 'lib/xml/kit/template.rb', line 8 def target @target end |
Instance Method Details
#to_xml(options = {}) ⇒ Object
Returns the compiled template as a [String].
17 18 19 |
# File 'lib/xml/kit/template.rb', line 17 def to_xml( = {}) template.render(target, ) end |