Class: Markaby::Rails::Template
- Inherits:
-
Object
- Object
- Markaby::Rails::Template
- Defined in:
- lib/markaby/rails/deprecated.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
Returns the value of attribute path.
-
#source ⇒ Object
Returns the value of attribute source.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(source) ⇒ Template
constructor
A new instance of Template.
- #render(*args) ⇒ Object
Constructor Details
#initialize(source) ⇒ Template
Returns a new instance of Template.
30 31 32 |
# File 'lib/markaby/rails/deprecated.rb', line 30 def initialize(source) @source = source.to_s end |
Instance Attribute Details
#path ⇒ Object
Returns the value of attribute path.
28 29 30 |
# File 'lib/markaby/rails/deprecated.rb', line 28 def path @path end |
#source ⇒ Object
Returns the value of attribute source.
28 29 30 |
# File 'lib/markaby/rails/deprecated.rb', line 28 def source @source end |
Class Method Details
.builder_class ⇒ Object
24 25 26 |
# File 'lib/markaby/rails/deprecated.rb', line 24 def self.builder_class @@builder_class ||= Builder end |
.builder_class=(builder) ⇒ Object
20 21 22 |
# File 'lib/markaby/rails/deprecated.rb', line 20 def self.builder_class=(builder) @@builder_class = builder end |
Instance Method Details
#render(*args) ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/markaby/rails/deprecated.rb', line 34 def render(*args) output = self.class.builder_class.new(*args) if path output.instance_eval source, path else output.instance_eval source end output.to_s end |