Module: SvgIcon
- Extended by:
- SvgIcon
- Included in:
- SvgIcon
- Defined in:
- lib/svg_icon.rb,
lib/svg_icon/helper.rb,
lib/svg_icon/version.rb,
lib/svg_icon/configuration.rb
Defined Under Namespace
Modules: Helper
Classes: Configuration, Error
Constant Summary
collapse
- VERSION =
"0.3.0"
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.configuration ⇒ Object
16
17
18
|
# File 'lib/svg_icon/configuration.rb', line 16
def self.configuration
@configuration ||= Configuration.new
end
|
.configuration=(config) ⇒ Object
20
21
22
|
# File 'lib/svg_icon/configuration.rb', line 20
def self.configuration=(config)
@configuration = config
end
|
24
25
26
27
|
# File 'lib/svg_icon/configuration.rb', line 24
def self.configure
yield configuration
SvgIcon.clear_cache!
end
|
Instance Method Details
#clear_cache! ⇒ Object
26
27
28
29
30
31
32
|
# File 'lib/svg_icon.rb', line 26
def clear_cache!
@file_data = nil
@icons = nil
@icons_json = nil
@extra_file_data = nil
@extra_icons = nil
end
|
#icons ⇒ Object
16
17
18
19
|
# File 'lib/svg_icon.rb', line 16
def icons
@icons ||= {}
@icons[icon] ||= MultiJson.load(file_data)
end
|
#icons_json ⇒ Object
21
22
23
24
|
# File 'lib/svg_icon.rb', line 21
def icons_json
@icons_json ||= {}
@icons_json[cache_key] ||= (icons)
end
|