Class: Easyrb::Runner
- Inherits:
-
Object
- Object
- Easyrb::Runner
- Defined in:
- lib/easyrb/runner.rb
Constant Summary collapse
- VALID_OPTIONS =
[:context, :helpers, :locals]
Instance Attribute Summary collapse
-
#erb_template ⇒ Object
readonly
# Declarations # #.
Instance Method Summary collapse
-
#initialize(erb_template) ⇒ Runner
constructor
# Constructor # #.
-
#run(options = {}) ⇒ Object
# Instance Methods # #.
Constructor Details
#initialize(erb_template) ⇒ Runner
# Constructor #
#
24 25 26 |
# File 'lib/easyrb/runner.rb', line 24 def initialize(erb_template) @erb_template = erb_template end |
Instance Attribute Details
#erb_template ⇒ Object (readonly)
# Declarations #
#
14 15 16 |
# File 'lib/easyrb/runner.rb', line 14 def erb_template @erb_template end |
Instance Method Details
#run(options = {}) ⇒ Object
# Instance Methods #
#
34 35 36 37 38 39 40 41 |
# File 'lib/easyrb/runner.rb', line 34 def run( = {}) () object = Easyrb::Context[[:context], [:helpers]] binding = Easyrb::Local[object, [:locals]] erb.result(binding) end |