Class: HighCarb::ViewsController::ViewContext
- Inherits:
-
Object
- Object
- HighCarb::ViewsController::ViewContext
- Defined in:
- lib/highcarb/views_controller.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#root ⇒ Object
readonly
Returns the value of attribute root.
Instance Method Summary collapse
-
#initialize(options, root) ⇒ ViewContext
constructor
A new instance of ViewContext.
- #load_coffe(source) ⇒ Object
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(, root) @options = @root = root end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
11 12 13 |
# File 'lib/highcarb/views_controller.rb', line 11 def @options end |
#root ⇒ Object (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 |