Class: Centra::Rule::OrderMatcher
- Inherits:
-
Object
- Object
- Centra::Rule::OrderMatcher
- Defined in:
- lib/centra/rule/order_matcher.rb
Overview
Match Centra orders with Rule sent emails
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
-
#initialize(orders_data) ⇒ OrderMatcher
constructor
# centra_orders & rule_orders types are Array<Order> data = { ‘[email protected]’ => { centra_orders: [], rule_orders: [] } } MatchOrders.new(data).
-
#matched ⇒ Hash
The matched orders.
-
#missing ⇒ Array<Order>
The Centra order that has no match.
Constructor Details
#initialize(orders_data) ⇒ OrderMatcher
# centra_orders & rule_orders types are Array<Order> data = {
'[email protected]' => { centra_orders: [], rule_orders: [] }
}
MatchOrders.new(data)
14 15 16 17 18 19 20 |
# File 'lib/centra/rule/order_matcher.rb', line 14 def initialize(orders_data) @matched_orders = [] @missing_order_emails = [] @data = orders_data perform(orders_data.email_orders) end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
5 6 7 |
# File 'lib/centra/rule/order_matcher.rb', line 5 def data @data end |
Instance Method Details
#matched ⇒ Hash
Returns the matched orders.
26 27 28 |
# File 'lib/centra/rule/order_matcher.rb', line 26 def matched @matched_orders end |
#missing ⇒ Array<Order>
Returns the Centra order that has no match.
31 32 33 |
# File 'lib/centra/rule/order_matcher.rb', line 31 def missing @missing_order_emails end |