Class: MimetypeXML::Generate

Inherits:
Object
  • Object
show all
Defined in:
lib/mimetype_xml/generate.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(toml) ⇒ Generate

Returns a new instance of Generate.



4
5
6
# File 'lib/mimetype_xml/generate.rb', line 4

def initialize toml
  @toml_hash = ParseTOML.parse toml
end

Class Method Details

.toml_file(file:, xml_dir:, icon_pack:) ⇒ Object



10
11
12
13
14
15
# File 'lib/mimetype_xml/generate.rb', line 10

def self.toml_file file:, xml_dir:, icon_pack:
  toml = File.read File.expand_path(file)
  hash = self.new(toml).parser

  XML.new :hash => hash, :dir => File.expand_path(xml_dir), :icon_pack => icon_pack
end

Instance Method Details

#parserObject



8
# File 'lib/mimetype_xml/generate.rb', line 8

def parser; @toml_hash; end