Class: LcpRuby::Dsl::DslLoader::ModelEvalContext

Inherits:
Object
  • Object
show all
Defined in:
lib/lcp_ruby/dsl/dsl_loader.rb

Overview

Evaluation context that captures raw model entries with inheritance metadata.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeModelEvalContext

Returns a new instance of ModelEvalContext.



274
275
276
# File 'lib/lcp_ruby/dsl/dsl_loader.rb', line 274

def initialize
  @entries = []
end

Instance Attribute Details

#entriesObject (readonly)

Returns the value of attribute entries.



272
273
274
# File 'lib/lcp_ruby/dsl/dsl_loader.rb', line 272

def entries
  @entries
end

Instance Method Details

#define_model(name, inherits: nil, &block) ⇒ Object



278
279
280
281
282
# File 'lib/lcp_ruby/dsl/dsl_loader.rb', line 278

def define_model(name, inherits: nil, &block)
  builder = ModelBuilder.new(name)
  builder.instance_eval(&block)
  @entries << { name: name.to_s, inherits: inherits&.to_s, builder: builder }
end