Class: WebConsole::Dependencies::View

Inherits:
View
  • Object
show all
Defined in:
lib/webconsole/dependencies/lib/view.rb

Constant Summary collapse

BASE_DIRECTORY =
File.join(File.dirname(__FILE__), '..')
VIEWS_DIRECTORY =
File.join(BASE_DIRECTORY, "views")
VIEW_TEMPLATE =
File.join(VIEWS_DIRECTORY, 'view.html.erb')
ADD_MISSING_DEPENDENCY_FUNCTION =
"addMissingDependency"

Constants inherited from View

View::CSS_EXTENSION, View::CSS_PATH_COMPONENT, View::JS_EXTENSION, View::JS_PATH_COMPONENT

Instance Attribute Summary

Attributes inherited from View

#title, #window

Instance Method Summary collapse

Methods inherited from View

#base_url=, #base_url_path=, #close, #do_javascript, #do_javascript_function, javascript_function, #javascript_include_tag, #load_erb, #load_erb_from_path, #load_html, #shared_javascript_include_tag, #shared_stylesheet_link_tag, #stylesheet_link_tag

Constructor Details

#initializeView

Returns a new instance of View.



8
9
10
11
12
# File 'lib/webconsole/dependencies/lib/view.rb', line 8

def initialize
  super
  self.base_url_path = File.expand_path(BASE_DIRECTORY)
  load_erb_from_path(VIEW_TEMPLATE)
end

Instance Method Details

#add_missing_dependency(name, type, installation_instructions = nil) ⇒ Object



15
16
17
# File 'lib/webconsole/dependencies/lib/view.rb', line 15

def add_missing_dependency(name, type, installation_instructions = nil)
  self.do_javascript_function(ADD_MISSING_DEPENDENCY_FUNCTION, [name, type, installation_instructions])
end