Class: VirtualModule::BaseSourceProvider
- Inherits:
-
Object
- Object
- VirtualModule::BaseSourceProvider
- Defined in:
- lib/virtual_module.rb
Direct Known Subclasses
Defined Under Namespace
Classes: KwargsConverter
Instance Attribute Summary collapse
-
#pkgs ⇒ Object
Returns the value of attribute pkgs.
-
#source ⇒ Object
Returns the value of attribute source.
Instance Method Summary collapse
-
#initialize(builder, pkgs, transpiler = nil) ⇒ BaseSourceProvider
constructor
A new instance of BaseSourceProvider.
- #lang ⇒ Object
- #load_packages ⇒ Object
- #vclass ⇒ Object (also: #vmethods, #to_s, #to_a)
Constructor Details
#initialize(builder, pkgs, transpiler = nil) ⇒ BaseSourceProvider
Returns a new instance of BaseSourceProvider.
186 187 188 189 190 191 192 |
# File 'lib/virtual_module.rb', line 186 def initialize(builder, pkgs, transpiler=nil) @builder = builder @pkgs = pkgs @transpiler = transpiler.nil? ? ->(s){s} : transpiler @source = [] @compiled_lib = "" end |
Instance Attribute Details
#pkgs ⇒ Object
Returns the value of attribute pkgs.
183 184 185 |
# File 'lib/virtual_module.rb', line 183 def pkgs @pkgs end |
#source ⇒ Object
Returns the value of attribute source.
182 183 184 |
# File 'lib/virtual_module.rb', line 182 def source @source end |
Instance Method Details
#lang ⇒ Object
198 199 200 |
# File 'lib/virtual_module.rb', line 198 def lang self.class.name.match(/\:\:(.*)SourceProvider/)[1].downcase.to_sym end |
#load_packages ⇒ Object
194 195 196 |
# File 'lib/virtual_module.rb', line 194 def load_packages [] #to be overrieded end |
#vclass ⇒ Object Also known as: vmethods, to_s, to_a
202 203 204 |
# File 'lib/virtual_module.rb', line 202 def vclass raise Exception.new("An equivalent method for #{__method__} seems not supported in #{lang}.") end |