MMCT TEAM
Server IP : 111.118.215.189  /  Your IP : 3.145.133.121
Web Server : Apache
System : Linux md-in-83.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : a1673wkz ( 2475)
PHP Version : 8.2.25
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /usr/share/ruby/vendor_ruby/puppet/vendor/rgen/lib/rgen/ecore/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //usr/share/ruby/vendor_ruby/puppet/vendor/rgen/lib/rgen/ecore/ecore_interface.rb
module RGen

module ECore

# Mixin to provide access to the ECore model describing a Ruby class or module
# built using MetamodelBuilder.
# The module should be used to +extend+ a class or module, i.e. to make its
# methods class methods.
# 
module ECoreInterface
  
  # This method will lazily build to ECore model element belonging to the calling
  # class or module using RubyToECore.
  # Alternatively, the ECore model element can be provided up front. This is used
  # when the Ruby metamodel classes and modules are created from ECore.
  # 
  def ecore
    if defined?(@ecore)
      @ecore
    else
      unless defined?(@@transformer)
        require 'rgen/ecore/ruby_to_ecore'
        @@transformer = RubyToECore.new
      end
      @@transformer.trans(self)
    end
  end  

  # This method can be used to clear the ecore cache after the metamodel classes
  # or modules have been changed; the ecore model will be recreated on next access
  # to the +ecore+ method
  # Beware, the ecore cache is global, i.e. for all metamodels.
  #
  def self.clear_ecore_cache
    require 'rgen/ecore/ruby_to_ecore'
    @@transformer = RubyToECore.new
  end

  def _set_ecore_internal(ecore) # :nodoc:
    @ecore = ecore
  end

end

end

end

MMCT - 2023