Class: YandexDirect::Campaign

Inherits:
Object
  • Object
show all
Defined in:
lib/services/campaign.rb

Constant Summary collapse

SERVICE =
'campaigns'

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ Campaign



6
7
# File 'lib/services/campaign.rb', line 6

def initialize(params)
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



4
5
6
# File 'lib/services/campaign.rb', line 4

def id
  @id
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/services/campaign.rb', line 4

def name
  @name
end

#start_dateObject

Returns the value of attribute start_date.



4
5
6
# File 'lib/services/campaign.rb', line 4

def start_date
  @start_date
end

#time_zoneObject

Returns the value of attribute time_zone.



4
5
6
# File 'lib/services/campaign.rb', line 4

def time_zone
  @time_zone
end

Class Method Details

.listObject



9
10
11
12
13
14
15
16
17
18
# File 'lib/services/campaign.rb', line 9

def self.list
  YandexDirect.request(SERVICE, 'get', { 
    "SelectionCriteria": {
      "Types": ["TEXT_CAMPAIGN"], 
      "States": ["OFF", "ON"], 
      "Statuses": ["ACCEPTED", "DRAFT", "MODERATION"]
    },
    "FieldNames": ['Id', 'Name', 'State', 'Status']
  })
end