Class: MovableErb::Erb
- Inherits:
-
Object
- Object
- MovableErb::Erb
- Defined in:
- lib/movable_erb.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#parsed_string ⇒ Object
Returns the value of attribute parsed_string.
-
#template ⇒ Object
Returns the value of attribute template.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
72 73 74 |
# File 'lib/movable_erb.rb', line 72 def data @data end |
#parsed_string ⇒ Object
Returns the value of attribute parsed_string.
72 73 74 |
# File 'lib/movable_erb.rb', line 72 def parsed_string @parsed_string end |
#template ⇒ Object
Returns the value of attribute template.
72 73 74 |
# File 'lib/movable_erb.rb', line 72 def template @template end |
Class Method Details
.setup {|erb| ... } ⇒ Object
74 75 76 77 78 |
# File 'lib/movable_erb.rb', line 74 def self.setup erb = self.new yield erb erb end |
Instance Method Details
#build! ⇒ Object
88 89 90 91 |
# File 'lib/movable_erb.rb', line 88 def build! erb = ERB.new(template, nil, '<>') @parsed_string = erb.result(binding) if erb end |
#setup {|_self| ... } ⇒ Object
84 85 86 |
# File 'lib/movable_erb.rb', line 84 def setup yield self end |