class PowerStencil::Engine::Base
Constants
- UNIVERSE_BASENAME
Attributes
dsl[RW]
root_universe[R]
Public Class Methods
new(universe = UniverseCompiler::Universe::Base.new(unique_name))
click to toggle source
# File lib/power_stencil/engine/base.rb, line 27 def initialize(universe = UniverseCompiler::Universe::Base.new(unique_name)) @root_universe = universe @dsl = PowerStencil::Dsl::Base end
Public Instance Methods
running_context(universe = root_universe, main_entry_point: nil)
click to toggle source
# File lib/power_stencil/engine/base.rb, line 32 def running_context(universe = root_universe, main_entry_point: nil) context = dsl.new universe context.main_entry_point = main_entry_point context.instance_eval do binding end end
Protected Instance Methods
load_system_entities()
click to toggle source
# File lib/power_stencil/engine/base.rb, line 42 def load_system_entities root_universe << PowerStencil::SystemEntityDefinitions::ProjectConfig.new(fields: PowerStencil.config[]) end
unique_name()
click to toggle source
# File lib/power_stencil/engine/base.rb, line 46 def unique_name '%s (%f)' % [UNIVERSE_BASENAME, Time.now.to_f] end