Class: AdWords::City2DMA

Inherits:
Struct
  • Object
show all
Defined in:
lib/adwords_location/city_2_dma.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#cityObject

Returns the value of attribute city

Returns:

  • (Object)

    the current value of city



5
6
7
# File 'lib/adwords_location/city_2_dma.rb', line 5

def city
  @city
end

#criteria_idObject

Returns the value of attribute criteria_id

Returns:

  • (Object)

    the current value of criteria_id



5
6
7
# File 'lib/adwords_location/city_2_dma.rb', line 5

def criteria_id
  @criteria_id
end

#dma_regionObject

Returns the value of attribute dma_region

Returns:

  • (Object)

    the current value of dma_region



5
6
7
# File 'lib/adwords_location/city_2_dma.rb', line 5

def dma_region
  @dma_region
end

#dma_region_codeObject

Returns the value of attribute dma_region_code

Returns:

  • (Object)

    the current value of dma_region_code



5
6
7
# File 'lib/adwords_location/city_2_dma.rb', line 5

def dma_region_code
  @dma_region_code
end

#stateObject

Returns the value of attribute state

Returns:

  • (Object)

    the current value of state



5
6
7
# File 'lib/adwords_location/city_2_dma.rb', line 5

def state
  @state
end

Class Method Details

.allObject



15
16
17
18
19
# File 'lib/adwords_location/city_2_dma.rb', line 15

def self.all 
  data.drop(1).map do |row|
    AdWords::City2DMA.new(row[0], row[1].to_i, row[2], row[3], row[4].to_i)
  end
end

Instance Method Details

#==(other) ⇒ Object



7
8
9
# File 'lib/adwords_location/city_2_dma.rb', line 7

def ==(other)
  self.criteria_id == other.criteria_id && self.dma_region_code == other.dma_region_code
end

#descriptionObject



11
12
13
# File 'lib/adwords_location/city_2_dma.rb', line 11

def description
  "#{dma_region},#{state}"
end