Class: Asset
- Inherits:
-
Object
- Object
- Asset
- Defined in:
- lib/generators/mcms_pages/templates/asset.rb
Overview
@File Name : lib/asset_manager.rb
@Company Name : Mindfire Solutions Private Limited
@Creator Name : Vikram Kumar Mishra
@Date Created : 2012-06-09
@Date Modified :
@Last Modification Details :
@Purpose : To include controller action specific JS and CSS.
Class Method Summary collapse
-
.get_css ⇒ Object
Array.
-
.get_libraries ⇒ Object
Array.
-
.include_css(file) ⇒ Object
To include individual CSS file.
-
.include_js_library(library, type = :local) ⇒ Object
To include JS files.
-
.include_local_library(library) ⇒ Object
TO include all JS file.
Class Method Details
.get_css ⇒ Object
Returns = Array.
87 88 89 90 91 92 |
# File 'lib/generators/mcms_pages/templates/asset.rb', line 87 def self.get_css # return class array return @@css_includes end |
.get_libraries ⇒ Object
Returns = Array.
78 79 80 81 82 83 |
# File 'lib/generators/mcms_pages/templates/asset.rb', line 78 def self.get_libraries # return class array return @@js_includes end |
.include_css(file) ⇒ Object
To include individual CSS file
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/generators/mcms_pages/templates/asset.rb', line 18 def self.include_css file # if param is of type Array if file.class == Array # loop through the param and include all files one by one file.each do |f| #calling include_css_file_individual to include css file include_css_file_individual f end # end each loop else #calling include_css_file_individual to include css file include_css_file_individual file end # end if end |
.include_js_library(library, type = :local) ⇒ Object
To include JS files
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/generators/mcms_pages/templates/asset.rb', line 53 def self.include_js_library library, type = :local #if param is of type array if library.class == Array # loop through the param and include all JS files one by one library.each do |l| #calling include_js_library_individual to include js file include_js_library_individual l, type end # end each loop else #calling include_js_library_individual to include js file include_js_library_individual library, type end # end if end |
.include_local_library(library) ⇒ Object
TO include all JS file
43 44 45 46 47 48 |
# File 'lib/generators/mcms_pages/templates/asset.rb', line 43 def self.include_local_library library #calling include_js_library to include specific JS files include_js_library library, :local end |