class Muwu::RenderHtmlPartial::JsLibrary

Public Class Methods

new() click to toggle source
# File lib/muwu/render_html_partial/render_js_library.rb, line 9
def initialize
  js_lib_folder = File.join(File.dirname(__FILE__), 'js_library')
  @js_lib_path = File.absolute_path(js_lib_folder)
end

Public Instance Methods

file_init() click to toggle source
# File lib/muwu/render_html_partial/render_js_library.rb, line 18
def file_init
  read_js_lib_file('init.js')
end
file_navigation() click to toggle source
# File lib/muwu/render_html_partial/render_js_library.rb, line 23
def file_navigation
  read_js_lib_file('navigation.js')
end
find(symbol) click to toggle source
# File lib/muwu/render_html_partial/render_js_library.rb, line 28
def find(symbol)
  case symbol
  when :init
    file_init
  when :navigation
    file_navigation
  end
end

Private Instance Methods

js_lib_filepath_to(filename) click to toggle source
# File lib/muwu/render_html_partial/render_js_library.rb, line 42
def js_lib_filepath_to(filename)
  File.absolute_path(File.join(@js_lib_path, filename))
end
read_js_lib_file(filename) click to toggle source
# File lib/muwu/render_html_partial/render_js_library.rb, line 47
def read_js_lib_file(filename)
  File.read(js_lib_filepath_to(filename))
end