Module: CodePages
- Defined in:
- lib/code_pages.rb,
lib/code-pages/version.rb,
lib/code-pages/importer.rb,
lib/code-pages/code_page.rb
Defined Under Namespace
Classes: CodePage, Importer
Constant Summary
collapse
- VERSION =
'1.0.0'
Class Method Summary
collapse
Class Method Details
.[](index) ⇒ Object
8
9
10
|
# File 'lib/code_pages.rb', line 8
def [](index)
all[index]
end
|
.all ⇒ Object
20
21
22
23
24
25
26
|
# File 'lib/code_pages.rb', line 20
def all
@all ||= manifest.each_with_object({}) do |props, ret|
ret[props['code_page']] = CodePage.new(
props['code_page'], File.join(resources_dir, "#{props['code_page']}.yml")
)
end
end
|
.manifest ⇒ Object
28
29
30
31
32
|
# File 'lib/code_pages.rb', line 28
def manifest
@manifest ||= YAML.load_file(
File.join(resources_dir, 'code_page_manifest.yml')
)
end
|
.resources_dir ⇒ Object
34
35
36
|
# File 'lib/code_pages.rb', line 34
def resources_dir
@resources_dir ||= File.expand_path('../../resources', __FILE__)
end
|
.supported_ids ⇒ Object
12
13
14
|
# File 'lib/code_pages.rb', line 12
def supported_ids
@supported_ids ||= all.keys
end
|
.supports?(id) ⇒ Boolean
16
17
18
|
# File 'lib/code_pages.rb', line 16
def supports?(id)
supported_ids.include?(id)
end
|