Class: Rory::Renderer::Context
- Inherits:
-
Object
- Object
- Rory::Renderer::Context
- Includes:
- PathGeneration
- Defined in:
- lib/rory/renderer/context.rb
Instance Attribute Summary collapse
-
#base_path ⇒ Object
readonly
Returns the value of attribute base_path.
Instance Method Summary collapse
- #get_binding ⇒ Object
-
#initialize(options = {}) ⇒ Context
constructor
A new instance of Context.
- #render(template_name, opts = {}) ⇒ Object
Methods included from PathGeneration
Constructor Details
#initialize(options = {}) ⇒ Context
Returns a new instance of Context.
9 10 11 12 13 14 15 |
# File 'lib/rory/renderer/context.rb', line 9 def initialize( = {}) ([:locals] || {}).each do |key, value| singleton_class.send(:define_method, key) { value } end @app = [:app] @base_path = [:base_path] end |
Instance Attribute Details
#base_path ⇒ Object (readonly)
Returns the value of attribute base_path.
7 8 9 |
# File 'lib/rory/renderer/context.rb', line 7 def base_path @base_path end |
Instance Method Details
#get_binding ⇒ Object
17 18 19 |
# File 'lib/rory/renderer/context.rb', line 17 def get_binding binding end |