class Tracco::Tracking::Factory
Constants
- DURATION_REGEXP
Public Class Methods
build_from(tracking_notification)
click to toggle source
# File lib/tracco/tracking/factory.rb, line 9 def self.build_from(tracking_notification) matching_pair = @match_pairs.find { |regexp, tracking_class| tracking_notification.data['text'] =~ regexp } tracking_class = matching_pair ? matching_pair.last : Tracking::InvalidTracking tracking_class.new(tracking_notification) end
Private Class Methods
match(match_pair)
click to toggle source
# File lib/tracco/tracking/factory.rb, line 18 def self.match(match_pair) @match_pairs.merge!(match_pair) end