Class: Campaign::DripContext

Inherits:
Data
  • Object
show all
Defined in:
app/services/campaign/drip_context.rb

Overview

Typed context passed to Campaign::AssignDripCampaigns#process.
All handlers that trigger drip campaign evaluation build one of these.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(party: nil, product_line_ids_added: [], product_line_ids_removed: [], buying_group_id_added: nil, buying_group_id_removed: nil, latitude: nil, longitude: nil) ⇒ DripContext

Returns a new instance of DripContext.



14
15
16
17
18
19
20
21
22
# File 'app/services/campaign/drip_context.rb', line 14

def initialize(
  party: nil,
  product_line_ids_added: [],
  product_line_ids_removed: [],
  buying_group_id_added: nil,
  buying_group_id_removed: nil,
  latitude: nil,
  longitude: nil
) = super

Instance Attribute Details

#buying_group_id_addedObject (readonly)

Returns the value of attribute buying_group_id_added

Returns:

  • (Object)

    the current value of buying_group_id_added



5
6
7
# File 'app/services/campaign/drip_context.rb', line 5

def buying_group_id_added
  @buying_group_id_added
end

#buying_group_id_removedObject (readonly)

Returns the value of attribute buying_group_id_removed

Returns:

  • (Object)

    the current value of buying_group_id_removed



5
6
7
# File 'app/services/campaign/drip_context.rb', line 5

def buying_group_id_removed
  @buying_group_id_removed
end

#latitudeObject (readonly)

Returns the value of attribute latitude

Returns:

  • (Object)

    the current value of latitude



5
6
7
# File 'app/services/campaign/drip_context.rb', line 5

def latitude
  @latitude
end

#longitudeObject (readonly)

Returns the value of attribute longitude

Returns:

  • (Object)

    the current value of longitude



5
6
7
# File 'app/services/campaign/drip_context.rb', line 5

def longitude
  @longitude
end

#partyObject (readonly)

Returns the value of attribute party

Returns:

  • (Object)

    the current value of party



5
6
7
# File 'app/services/campaign/drip_context.rb', line 5

def party
  @party
end

#product_line_ids_addedObject (readonly)

Returns the value of attribute product_line_ids_added

Returns:

  • (Object)

    the current value of product_line_ids_added



5
6
7
# File 'app/services/campaign/drip_context.rb', line 5

def product_line_ids_added
  @product_line_ids_added
end

#product_line_ids_removedObject (readonly)

Returns the value of attribute product_line_ids_removed

Returns:

  • (Object)

    the current value of product_line_ids_removed



5
6
7
# File 'app/services/campaign/drip_context.rb', line 5

def product_line_ids_removed
  @product_line_ids_removed
end