class RGen::ECore::ECoreToRuby::FeatureWrapper

Public Class Methods

new(efeature, classifiers) click to toggle source
# File lib/rgen/ecore/ecore_to_ruby.rb, line 148
def initialize(efeature, classifiers)
  @efeature = efeature
  @classifiers = classifiers
end

Public Instance Methods

impl_type() click to toggle source
# File lib/rgen/ecore/ecore_to_ruby.rb, line 165
def impl_type
  etype = @efeature.eType
  if etype.is_a?(RGen::ECore::EClass) || etype.is_a?(RGen::ECore::EEnum)
    @classifiers[etype]
  else
    ic = etype.instanceClass
    if ic
      ic
    else
      raise "unknown type: #{etype.name}" 
    end
  end
end
many?() click to toggle source
# File lib/rgen/ecore/ecore_to_ruby.rb, line 156
def many?
  @efeature.many
end
opposite() click to toggle source
# File lib/rgen/ecore/ecore_to_ruby.rb, line 162
def opposite
  @efeature.eOpposite
end
reference?() click to toggle source
# File lib/rgen/ecore/ecore_to_ruby.rb, line 159
def reference?
  @efeature.is_a?(RGen::ECore::EReference)
end
value(prop) click to toggle source
# File lib/rgen/ecore/ecore_to_ruby.rb, line 152
def value(prop)
  return false if prop == :containment && @efeature.is_a?(RGen::ECore::EAttribute)
  @efeature.send(prop)
end