Class: CampaignState

Inherits:
Object
  • Object
show all
Defined in:
lib/adcloud/campaign_state.rb

Constant Summary collapse

STATES =
{
  :inactive => 0,
  :online => 1,
  :offer => 2,
  :rejected => 3,
  :accepted => 4,
  :awaiting_approval => 5,
  :paused => 6,
  :ended => 7,
  :billed => 9,
  :paid => 10,
  :approved => 11,
  :canceled => 12,
  :approval_rejected => 13,
}

Instance Method Summary collapse

Instance Method Details

#id_to_string(id) ⇒ Object



18
19
20
# File 'lib/adcloud/campaign_state.rb', line 18

def id_to_string(id)
  STATES.find { |_, value| value.to_s == id.to_s }
end

#string_to_id(string) ⇒ Object



22
23
24
# File 'lib/adcloud/campaign_state.rb', line 22

def string_to_id(string)
  STATES[string.to_sym]
end