class MoesifApi::CampaignModel

Attributes

gclid[RW]

the gclid @return [String]

referrer[RW]

the referrer @return [String]

referring_domain[RW]

the referring domain @return [String]

utm_campaign[RW]

the utm campaign @return [String]

utm_content[RW]

the utm content @return [String]

utm_medium[RW]

the utm medium @return [String]

utm_source[RW]

the utm source @return [String]

utm_term[RW]

the utm term @return [String]

Public Class Methods

from_hash(hash) click to toggle source

Creates an instance of the object from a hash

# File lib/moesif_api/models/campaign_model.rb, line 72
def self.from_hash(hash)
  if hash == nil
    nil
  else
    # Extract variables from the hash
    utm_source = hash["utm_source"]
    utm_medium = hash["utm_medium"]
    utm_campaign = hash["utm_campaign"]
    utm_term = hash["utm_term"]
    utm_content = hash["utm_content"]
    referrer = hash["referrer"]
    referring_domain = hash["referring_domain"]
    gclid = hash["gclid"]

    # Create object from extracted values
    CampaignModel.new(utm_source,
                    utm_medium,
                    utm_campaign,
                    utm_term,
                    utm_content,
                    referrer,
                    referring_domain,
                    gclid)
  end
end
names() click to toggle source

A mapping from model property names to API property names

# File lib/moesif_api/models/campaign_model.rb, line 38
def self.names
  if @hash.nil?
    @hash = {}
    @hash["utm_source"] = "utm_source"
    @hash["utm_medium"] = "utm_medium"
    @hash["utm_campaign"] = "utm_campaign"
    @hash["utm_term"] = "utm_term"
    @hash["utm_content"] = "utm_content"
    @hash["referrer"] = "referrer"
    @hash["referring_domain"] = "referring_domain"
    @hash["gclid"] = "gclid"
  end
  @hash
end
new(utm_source = nil, utm_medium = nil, utm_campaign = nil, utm_term = nil, utm_content = nil, referrer = nil, referring_domain = nil, gclid = nil) click to toggle source
# File lib/moesif_api/models/campaign_model.rb, line 53
def initialize(utm_source = nil,
        utm_medium = nil,
        utm_campaign = nil,
        utm_term = nil,
        utm_content = nil,
        referrer = nil,
        referring_domain = nil,
        gclid = nil)
  @utm_source = utm_source
  @utm_medium = utm_medium
  @utm_campaign = utm_campaign
  @utm_term = utm_term
  @utm_content = utm_content
  @referrer = referrer
  @referring_domain = referring_domain
  @gclid = gclid
end