Class: Coronet::TransformationRule
- Inherits:
-
Object
- Object
- Coronet::TransformationRule
- Defined in:
- lib/coronet/transformation_rule.rb
Instance Attribute Summary collapse
-
#in ⇒ Object
Returns the value of attribute in.
-
#out ⇒ Object
Returns the value of attribute out.
Instance Method Summary collapse
- #apply(message) ⇒ Object
-
#initialize(incoming, outgoing) ⇒ TransformationRule
constructor
A new instance of TransformationRule.
- #inverse ⇒ Object
Constructor Details
#initialize(incoming, outgoing) ⇒ TransformationRule
Returns a new instance of TransformationRule.
5 6 7 8 |
# File 'lib/coronet/transformation_rule.rb', line 5 def initialize(incoming, outgoing) @in = incoming @out = outgoing end |
Instance Attribute Details
#in ⇒ Object
Returns the value of attribute in.
3 4 5 |
# File 'lib/coronet/transformation_rule.rb', line 3 def in @in end |
#out ⇒ Object
Returns the value of attribute out.
3 4 5 |
# File 'lib/coronet/transformation_rule.rb', line 3 def out @out end |
Instance Method Details
#apply(message) ⇒ Object
10 11 12 |
# File 'lib/coronet/transformation_rule.rb', line 10 def apply() @in.transform(, @out) end |
#inverse ⇒ Object
14 |
# File 'lib/coronet/transformation_rule.rb', line 14 def inverse; TransformationRule.new(@out, @in); end |