Class: Tipsy::View::Context

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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_contextObject (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

#requestObject (readonly)

Returns the value of attribute request.



8
9
10
# File 'lib/tipsy/view/context.rb', line 8

def request
  @request
end

#templateObject (readonly)

Returns the value of attribute template.



8
9
10
# File 'lib/tipsy/view/context.rb', line 8

def template
  @template
end

#virtual_pathObject (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