Class: Ynl::Family
- Inherits:
-
Object
- Object
- Ynl::Family
- Defined in:
- ynl/lib/ynl/family.rb
Overview
Entry points for generating family classes from YNL specifications.
Class Method Summary collapse
-
.build(path) ⇒ Class<Nl::Family>
Builds a family class from a YNL specification file.
-
.generate(source, out, **kwargs) ⇒ String
Generates Ruby source code to define a family class from a YNL specification.
Class Method Details
.build(path) ⇒ Class<Nl::Family>
Builds a family class from a YNL specification file.
14 15 16 17 18 19 |
# File 'ynl/lib/ynl/family.rb', line 14 def self.build(path) buf = StringIO.new(Generator::PRELUDE.dup) classname = File.open(path) {|f| generate(f, buf, namespace: 'self') } Module.new { eval(buf.string) }.const_get(classname) end |