Class: LcpRuby::Dsl::DslLoader::ModelEvalContext
- Inherits:
-
Object
- Object
- LcpRuby::Dsl::DslLoader::ModelEvalContext
- Defined in:
- lib/lcp_ruby/dsl/dsl_loader.rb
Overview
Evaluation context that captures raw model entries with inheritance metadata.
Instance Attribute Summary collapse
-
#entries ⇒ Object
readonly
Returns the value of attribute entries.
Instance Method Summary collapse
- #define_model(name, inherits: nil, &block) ⇒ Object
-
#initialize ⇒ ModelEvalContext
constructor
A new instance of ModelEvalContext.
Constructor Details
#initialize ⇒ ModelEvalContext
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
#entries ⇒ Object (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 |