Class: HighCarb::ViewsController::ViewContext

Inherits:
Object
  • Object
show all
Defined in:
lib/highcarb/views_controller.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options, root) ⇒ ViewContext

Returns a new instance of ViewContext.



12
13
14
15
# File 'lib/highcarb/views_controller.rb', line 12

def initialize(options, root)
  @options = options
  @root = root
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



11
12
13
# File 'lib/highcarb/views_controller.rb', line 11

def options
  @options
end

#rootObject (readonly)

Returns the value of attribute root.



11
12
13
# File 'lib/highcarb/views_controller.rb', line 11

def root
  @root
end

Instance Method Details

#load_coffe(source) ⇒ Object



17
18
19
# File 'lib/highcarb/views_controller.rb', line 17

def load_coffe(source)
  "<script>//<![CDATA[\n" + CoffeeScript.compile(root.join(source + ".coffee").read) + "\n//]]></script>"
end