Class: HighCarb::ViewsController::ViewContext
- Inherits:
-
Object
- Object
- HighCarb::ViewsController::ViewContext
- Defined in:
- lib/highcarb/views_controller.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#root ⇒ Object
readonly
Returns the value of attribute root.
Instance Method Summary collapse
-
#initialize(app, options, root) ⇒ ViewContext
constructor
A new instance of ViewContext.
- #jquery_path ⇒ Object
- #load_coffe(source) ⇒ Object
Constructor Details
#initialize(app, options, root) ⇒ ViewContext
Returns a new instance of ViewContext.
12 13 14 15 16 |
# File 'lib/highcarb/views_controller.rb', line 12 def initialize(app, , root) @app = app @options = @root = root end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
11 12 13 |
# File 'lib/highcarb/views_controller.rb', line 11 def app @app end |
#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
#jquery_path ⇒ Object
22 23 24 |
# File 'lib/highcarb/views_controller.rb', line 22 def jquery_path Dir.chdir(root) { Dir["assets/vendor/deck.js/jquery-*.js"].first } end |
#load_coffe(source) ⇒ Object
18 19 20 |
# File 'lib/highcarb/views_controller.rb', line 18 def load_coffe(source) "<script>//<![CDATA[\n" + CoffeeScript.compile(root.join(source + ".coffee").read) + "\n//]]></script>" end |