Class: Seory::Runtime

Inherits:
Object
  • Object
show all
Defined in:
lib/seory/runtime.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(page_contents, controller, fallback = nil) ⇒ Runtime

Returns a new instance of Runtime.



9
10
11
12
13
14
15
# File 'lib/seory/runtime.rb', line 9

def initialize(page_contents, controller, fallback = nil)
  @page_contents = page_contents
  @controller    = controller
  @fallback      = fallback

  extend build_assign_accessor_module(@page_contents.assign_name_accessors)
end

Instance Attribute Details

#controllerObject (readonly)

Returns the value of attribute controller.



7
8
9
# File 'lib/seory/runtime.rb', line 7

def controller
  @controller
end

#page_contentsObject (readonly)

Returns the value of attribute page_contents.



7
8
9
# File 'lib/seory/runtime.rb', line 7

def page_contents
  @page_contents
end

Instance Method Details

#assigns(name) ⇒ Object



17
18
19
# File 'lib/seory/runtime.rb', line 17

def assigns(name)
  @controller.view_assigns[name.to_s]
end

#misc(name) ⇒ Object



21
22
23
# File 'lib/seory/runtime.rb', line 21

def misc(name)
  calculate_content_for(name)
end