Class: AdRoll::Api::Rule

Inherits:
Service show all
Defined in:
lib/adroll/rule.rb

Class Method Summary collapse

Class Method Details

.create(pixel:, type:, order:, name:, display_name:, pattern:, source:) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/adroll/rule.rb', line 5

def create(pixel:, type:, order:, name:, display_name:, pattern:, source:)
  params = {
    pixel: pixel,
    type: type,
    order: order,
    name: name,
    display_name: display_name,
    pattern: pattern,
    source: source
  }.reject { |_, value| value.nil? }

  call_api(:post, __method__, params)
end

.edit(rule:, order:, name:, display_name:, pattern:, source:) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/adroll/rule.rb', line 19

def edit(rule:, order:, name:, display_name:, pattern:, source:)
  params = {
    rule: rule,
    order: order,
    name: name,
    display_name: display_name,
    pattern: pattern,
    source: source
  }.reject { |_, value| value.nil? }

  call_api(:put, __method__, params)
end

.get(rule:) ⇒ Object



32
33
34
35
36
37
38
# File 'lib/adroll/rule.rb', line 32

def get(rule:)
  params = {
    rule: rule
  }.reject { |_, value| value.nil? }

  call_api(:get, __method__, params)
end

.get_segments(rule:) ⇒ Object



40
41
42
43
44
45
46
# File 'lib/adroll/rule.rb', line 40

def get_segments(rule:)
  params = {
    rule: rule
  }.reject { |_, value| value.nil? }

  call_api(:get, __method__, params)
end