Class: LcpRuby::Dsl::DslLoader::TypeEvalContext
- Inherits:
-
Object
- Object
- LcpRuby::Dsl::DslLoader::TypeEvalContext
- Defined in:
- lib/lcp_ruby/dsl/dsl_loader.rb
Overview
Isolated evaluation context for type DSL files.
Instance Attribute Summary collapse
-
#type_definitions ⇒ Object
readonly
Returns the value of attribute type_definitions.
Instance Method Summary collapse
- #define_type(name, &block) ⇒ Object
-
#initialize ⇒ TypeEvalContext
constructor
A new instance of TypeEvalContext.
Constructor Details
#initialize ⇒ TypeEvalContext
Returns a new instance of TypeEvalContext.
289 290 291 |
# File 'lib/lcp_ruby/dsl/dsl_loader.rb', line 289 def initialize @type_definitions = [] end |
Instance Attribute Details
#type_definitions ⇒ Object (readonly)
Returns the value of attribute type_definitions.
287 288 289 |
# File 'lib/lcp_ruby/dsl/dsl_loader.rb', line 287 def type_definitions @type_definitions end |
Instance Method Details
#define_type(name, &block) ⇒ Object
293 294 295 296 297 298 |
# File 'lib/lcp_ruby/dsl/dsl_loader.rb', line 293 def define_type(name, &block) builder = TypeBuilder.new(name) builder.instance_eval(&block) hash = builder.to_hash @type_definitions << Types::TypeDefinition.from_hash(hash) end |