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(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, options, root)
  @app = app
  @options = options
  @root = root
end

Instance Attribute Details

#appObject (readonly)

Returns the value of attribute app.



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

def app
  @app
end

#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

#jquery_pathObject



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