Class: UtmTracker::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/utm_tracker.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object, utm_data) ⇒ Client

Returns a new instance of Client.



11
12
13
14
# File 'lib/utm_tracker.rb', line 11

def initialize(object, utm_data)
  @object = object
  @utm_matcher = UtmTracker::Matcher.new(utm_data)
end

Instance Attribute Details

#objectObject

Returns the value of attribute object.



9
10
11
# File 'lib/utm_tracker.rb', line 9

def object
  @object
end

#utm_matcherObject

Returns the value of attribute utm_matcher.



9
10
11
# File 'lib/utm_tracker.rb', line 9

def utm_matcher
  @utm_matcher
end

Instance Method Details

#callObject



16
17
18
19
20
21
22
# File 'lib/utm_tracker.rb', line 16

def call
  return :nok if utm_matcher.utm_data.empty?

  match_utm_tags
  save_utm_tags_into_database!
  :ok
end