Class: SchemaFiles

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby3mf/schema_files.rb

Constant Summary collapse

SchemaTemplate =
File.join(File.dirname(__FILE__), "3MFcoreSpec_1.1.xsd.template")
SchemaLocation =
File.join(File.dirname(__FILE__), "xml.xsd")

Class Method Summary collapse

Class Method Details

.open(file) {|SchemaFiles.render| ... } ⇒ Object

Yields:



10
11
12
13
14
15
16
17
# File 'lib/ruby3mf/schema_files.rb', line 10

def open(file)
  @@template ||= File.open(file, "r") do |file|
    file.read
  end

  yield(SchemaFiles.render)

end

.renderObject



19
20
21
# File 'lib/ruby3mf/schema_files.rb', line 19

def render
   @@xsd_content ||= ERB.new(@@template).result( binding )
end