Class: VirtualModule::BaseSourceProvider

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

Direct Known Subclasses

JuliaSourceProvider, PythonSourceProvider

Defined Under Namespace

Classes: KwargsConverter

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#pkgsObject

Returns the value of attribute pkgs.



183
184
185
# File 'lib/virtual_module.rb', line 183

def pkgs
  @pkgs
end

#sourceObject

Returns the value of attribute source.



182
183
184
# File 'lib/virtual_module.rb', line 182

def source
  @source
end

Instance Method Details

#langObject



198
199
200
# File 'lib/virtual_module.rb', line 198

def lang
  self.class.name.match(/\:\:(.*)SourceProvider/)[1].downcase.to_sym
end

#load_packagesObject



194
195
196
# File 'lib/virtual_module.rb', line 194

def load_packages
  [] #to be overrieded
end

#vclassObject Also known as: vmethods, to_s, to_a

Raises:

  • (Exception)


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