Class: RGen::MetamodelBuilder::Intermediate::Reference
- Defined in:
- lib/rgen/metamodel_builder/intermediate/feature.rb
Constant Summary collapse
- Properties =
{ :name => :required, :ordered => :required, :unique => :required, :changeable => :required, :volatile => :required, :transient => :required, :unsettable => :required, :derived => :required, :lowerBound => :required, :upperBound => :required, :resolveProxies => :required, :containment => :required }
- Defaults =
{ :ordered => true, :unique => true, :changeable => true, :volatile => false, :transient => false, :unsettable => false, :derived => false, :lowerBound => 0, :resolveProxies => true }
Instance Attribute Summary collapse
-
#opposite ⇒ Object
Returns the value of attribute opposite.
Attributes inherited from Feature
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(type, props) ⇒ Reference
constructor
A new instance of Reference.
Methods inherited from Feature
#annotations, #many?, #reference?, #value
Constructor Details
#initialize(type, props) ⇒ Reference
Returns a new instance of Reference.
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 |
# File 'lib/rgen/metamodel_builder/intermediate/feature.rb', line 145 def initialize(type, props) @props = Defaults.merge(props) if type.respond_to?(:_metamodel_description) @etype = nil @impl_type = type else raise ArgumentError.new("'#{type}' (#{type.class}) is not a MMBase in reference #{props[:name]}") end if @props[:derived] @props[:changeable] = false @props[:volatile] = true @props[:transient] = true end check(Properties) end |
Instance Attribute Details
#opposite ⇒ Object
Returns the value of attribute opposite.
108 109 110 |
# File 'lib/rgen/metamodel_builder/intermediate/feature.rb', line 108 def opposite @opposite end |
Class Method Details
.default_value(prop) ⇒ Object
137 138 139 |
# File 'lib/rgen/metamodel_builder/intermediate/feature.rb', line 137 def self.default_value(prop) Defaults[prop] end |
.properties ⇒ Object
141 142 143 |
# File 'lib/rgen/metamodel_builder/intermediate/feature.rb', line 141 def self.properties Properties.keys.sort{|a,b| a.to_s <=> b.to_s} end |