Module: Sampl::ClassMethods

Defined in:
lib/sampl.rb

Instance Method Summary collapse

Instance Method Details

#app_token(app_token = nil) ⇒ Object



42
43
44
45
46
47
48
# File 'lib/sampl.rb', line 42

def app_token(app_token=nil)
  if app_token.nil?
    default_arguments[:app_token]  
  else
    default_arguments[:app_token] = app_token
  end
end

#default_argumentsObject

:nodoc:



30
31
32
# File 'lib/sampl.rb', line 30

def default_arguments #:nodoc:
  @default_arguments
end

#endpoint(endpoint = nil) ⇒ Object



34
35
36
37
38
39
40
# File 'lib/sampl.rb', line 34

def endpoint(endpoint=nil)
  if endpoint.nil?
    @default_endpoint
  else
    @default_endpoint = endpoint
  end
end

#server_side(flag = nil) ⇒ Object



50
51
52
53
54
55
56
# File 'lib/sampl.rb', line 50

def server_side(flag=nil)
  if flag.nil?
    default_arguments[:server_side]  
  else
    default_arguments[:server_side] = flag
  end
end

#track(event_name, event_category = "custom", arguments = {}, &block) ⇒ Object



58
59
60
# File 'lib/sampl.rb', line 58

def track(event_name, event_category="custom", arguments={}, &block)
  perform_tracking event_name, event_category, arguments, &block
end

#versionObject



26
27
28
# File 'lib/sampl.rb', line 26

def version
  Sampl::VERSION
end