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? ⇒ Boolean
- #opposite ⇒ Object
- #reference? ⇒ Boolean
- #value(prop) ⇒ Object
Constructor Details
#initialize(efeature, classifiers) ⇒ FeatureWrapper
Returns a new instance of FeatureWrapper.
161 162 163 164 |
# File 'lib/rgen/ecore/ecore_to_ruby.rb', line 161 def initialize(efeature, classifiers) @efeature = efeature @classifiers = classifiers end |
Instance Method Details
#impl_type ⇒ Object
178 179 180 181 182 183 184 185 186 187 188 189 190 |
# File 'lib/rgen/ecore/ecore_to_ruby.rb', line 178 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? ⇒ Boolean
169 170 171 |
# File 'lib/rgen/ecore/ecore_to_ruby.rb', line 169 def many? @efeature.many end |
#opposite ⇒ Object
175 176 177 |
# File 'lib/rgen/ecore/ecore_to_ruby.rb', line 175 def opposite @efeature.eOpposite end |
#reference? ⇒ Boolean
172 173 174 |
# File 'lib/rgen/ecore/ecore_to_ruby.rb', line 172 def reference? @efeature.is_a?(RGen::ECore::EReference) end |
#value(prop) ⇒ Object
165 166 167 168 |
# File 'lib/rgen/ecore/ecore_to_ruby.rb', line 165 def value(prop) return false if prop == :containment && @efeature.is_a?(RGen::ECore::EAttribute) @efeature.send(prop) end |