Class: Tipsy::View::Context
- Inherits:
-
Object
- Object
- Tipsy::View::Context
- Defined in:
- lib/tipsy/view/context.rb
Overview
All views are rendered within a context object. This object handles transitioning data between templates and layouts.
Instance Attribute Summary collapse
-
#layout(set = nil) ⇒ Object
readonly
Returns the value of attribute layout.
-
#lookup_context ⇒ Object
readonly
Returns the value of attribute lookup_context.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
-
#template ⇒ Object
readonly
Returns the value of attribute template.
-
#virtual_path ⇒ Object
readonly
Returns the value of attribute virtual_path.
Instance Method Summary collapse
-
#initialize(request, template, path, lookup) ⇒ Context
constructor
A new instance of Context.
Constructor Details
#initialize(request, template, path, lookup) ⇒ Context
Returns a new instance of Context.
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/tipsy/view/context.rb', line 10 def initialize(request, template, path, lookup) @request = request @layout = 'default' @template = template @virtual_path = path @lookup_context = lookup @output_buffer = nil self.class_eval do include Tipsy::Helpers end end |
Instance Attribute Details
#layout(set = nil) ⇒ Object (readonly)
Returns the value of attribute layout.
8 9 10 |
# File 'lib/tipsy/view/context.rb', line 8 def layout @layout end |
#lookup_context ⇒ Object (readonly)
Returns the value of attribute lookup_context.
8 9 10 |
# File 'lib/tipsy/view/context.rb', line 8 def lookup_context @lookup_context end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
8 9 10 |
# File 'lib/tipsy/view/context.rb', line 8 def request @request end |
#template ⇒ Object (readonly)
Returns the value of attribute template.
8 9 10 |
# File 'lib/tipsy/view/context.rb', line 8 def template @template end |
#virtual_path ⇒ Object (readonly)
Returns the value of attribute virtual_path.
8 9 10 |
# File 'lib/tipsy/view/context.rb', line 8 def virtual_path @virtual_path end |