Class: TrafficSources

Inherits:
Array
  • Object
show all
Defined in:
lib/visitor_sources/traffic_sources.rb

Instance Method Summary collapse

Constructor Details

#initialize(string) ⇒ TrafficSources

Returns a new instance of TrafficSources.



3
4
5
6
7
8
# File 'lib/visitor_sources/traffic_sources.rb', line 3

def initialize(string)    
  traffic_source_strings = string.split(",")
  traffic_source_strings.each do |string|
    self << TrafficSource.initialize_from_string(string)
  end
end

Instance Method Details

#to_sObject



10
11
12
# File 'lib/visitor_sources/traffic_sources.rb', line 10

def to_s
  each.collect(&:to_s).join(",")
end