Class: TrafficSources
- Inherits:
-
Array
- Object
- Array
- TrafficSources
- Defined in:
- lib/visitor_sources/traffic_sources.rb
Instance Method Summary collapse
-
#initialize(string) ⇒ TrafficSources
constructor
A new instance of TrafficSources.
- #to_s ⇒ Object
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_s ⇒ Object
10 11 12 |
# File 'lib/visitor_sources/traffic_sources.rb', line 10 def to_s each.collect(&:to_s).join(",") end |