Class: Uinit::Structure::Compilers::Base
- Inherits:
-
Object
- Object
- Uinit::Structure::Compilers::Base
- Defined in:
- lib/uinit/structure/compilers/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#mod ⇒ Object
readonly
Returns the value of attribute mod.
Class Method Summary collapse
Instance Method Summary collapse
- #compile_method(str, file, line) ⇒ Object
-
#initialize(mod) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(mod) ⇒ Base
Returns a new instance of Base.
11 12 13 |
# File 'lib/uinit/structure/compilers/base.rb', line 11 def initialize(mod) @mod = mod end |
Instance Attribute Details
#mod ⇒ Object (readonly)
Returns the value of attribute mod.
15 16 17 |
# File 'lib/uinit/structure/compilers/base.rb', line 15 def mod @mod end |
Class Method Details
.compile ⇒ Object
7 8 9 |
# File 'lib/uinit/structure/compilers/base.rb', line 7 def self.compile(...) new(...).compile end |
Instance Method Details
#compile_method(str, file, line) ⇒ Object
17 18 19 |
# File 'lib/uinit/structure/compilers/base.rb', line 17 def compile_method(str, file, line) mod.class_eval(str.gsub(/^$\s*\n/, '').gsub(/\s+$/, ''), file, line) end |