Class: RGen::ECore::ECoreToRuby::FeatureWrapper
- Inherits:
-
Object
- Object
- RGen::ECore::ECoreToRuby::FeatureWrapper
- Defined in:
- lib/rgen/ecore/ecore_to_ruby.rb
Instance Method Summary collapse
- #impl_type ⇒ Object
-
#initialize(efeature, classifiers) ⇒ FeatureWrapper
constructor
A new instance of FeatureWrapper.
- #many ⇒ Object
- #opposite ⇒ Object
- #reference? ⇒ Boolean
- #value(prop) ⇒ Object
Constructor Details
#initialize(efeature, classifiers) ⇒ FeatureWrapper
Returns a new instance of FeatureWrapper.
97 98 99 100 |
# File 'lib/rgen/ecore/ecore_to_ruby.rb', line 97 def initialize(efeature, classifiers) @efeature = efeature @classifiers = classifiers end |
Instance Method Details
#impl_type ⇒ Object
113 114 115 116 117 118 119 120 121 122 123 124 125 |
# File 'lib/rgen/ecore/ecore_to_ruby.rb', line 113 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 ⇒ Object
104 105 106 |
# File 'lib/rgen/ecore/ecore_to_ruby.rb', line 104 def many @efeature.many end |
#opposite ⇒ Object
110 111 112 |
# File 'lib/rgen/ecore/ecore_to_ruby.rb', line 110 def opposite @efeature.eOpposite end |
#reference? ⇒ Boolean
107 108 109 |
# File 'lib/rgen/ecore/ecore_to_ruby.rb', line 107 def reference? @efeature.is_a?(RGen::ECore::EReference) end |
#value(prop) ⇒ Object
101 102 103 |
# File 'lib/rgen/ecore/ecore_to_ruby.rb', line 101 def value(prop) @efeature.send(prop) end |