Module: Iconify::Ruby
Defined Under Namespace
Classes: Error
Constant Summary collapse
- VERSION =
"0.2.0"
Instance Method Summary collapse
Instance Method Details
#collections ⇒ Object
16 17 18 19 |
# File 'lib/iconify/ruby.rb', line 16 def collections() data = File.read(File.join(dir, "collections.json")) JSON.parse(data) end |
#dir ⇒ Object
12 13 14 |
# File 'lib/iconify/ruby.rb', line 12 def dir() File.("../../iconify-json", __dir__) end |
#locate(name) ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/iconify/ruby.rb', line 21 def locate(name) begin data = File.read(File.join(dir, "json/#{name}.json")) JSON.parse(data) rescue => exception { error: exception } end end |