Class: Ea::Transformers::QeaToXmi::RunState::Binding
- Inherits:
-
Struct
- Object
- Struct
- Ea::Transformers::QeaToXmi::RunState::Binding
- Defined in:
- lib/ea/transformers/qea_to_xmi/run_state.rb
Overview
A single parsed RunState variable binding.
Instance Attribute Summary collapse
-
#op ⇒ Object
readonly
the operator character(s) EA stored.
-
#value ⇒ Object
readonly
the literal value text.
-
#variable ⇒ Object
readonly
the attribute name on the classifier.
Instance Method Summary collapse
-
#body ⇒ String
Sparx serialises the value with the operator character prepended (
Op==→body="=Value").
Instance Attribute Details
#op ⇒ Object (readonly)
the operator character(s) EA stored
34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/ea/transformers/qea_to_xmi/run_state.rb', line 34 Binding = Struct.new(:variable, :value, :op) do # Sparx serialises the value with the operator character # prepended (`Op==` → `body="=Value"`). For other operators # (`!=`, `<`, `>`) the full operator string is prepended. # # @return [String] the body to set on the OpaqueExpression def body return value if op.nil? || op.empty? "#{op[0]}#{value}" end end |
#value ⇒ Object (readonly)
the literal value text
34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/ea/transformers/qea_to_xmi/run_state.rb', line 34 Binding = Struct.new(:variable, :value, :op) do # Sparx serialises the value with the operator character # prepended (`Op==` → `body="=Value"`). For other operators # (`!=`, `<`, `>`) the full operator string is prepended. # # @return [String] the body to set on the OpaqueExpression def body return value if op.nil? || op.empty? "#{op[0]}#{value}" end end |
#variable ⇒ Object (readonly)
the attribute name on the classifier
34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/ea/transformers/qea_to_xmi/run_state.rb', line 34 Binding = Struct.new(:variable, :value, :op) do # Sparx serialises the value with the operator character # prepended (`Op==` → `body="=Value"`). For other operators # (`!=`, `<`, `>`) the full operator string is prepended. # # @return [String] the body to set on the OpaqueExpression def body return value if op.nil? || op.empty? "#{op[0]}#{value}" end end |
Instance Method Details
#body ⇒ String
Sparx serialises the value with the operator character
prepended (Op== → body="=Value"). For other operators
(!=, <, >) the full operator string is prepended.
40 41 42 43 44 |
# File 'lib/ea/transformers/qea_to_xmi/run_state.rb', line 40 def body return value if op.nil? || op.empty? "#{op[0]}#{value}" end |