Module: TrueandcoAnalytics::Config::Params

Defined in:
lib/trueandco_analytics/config/params.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.buy_selectorObject

Returns the value of attribute buy_selector.



44
45
46
# File 'lib/trueandco_analytics/config/params.rb', line 44

def buy_selector
  @buy_selector
end

.connect_redisObject (readonly)

Returns the value of attribute connect_redis.



44
45
46
# File 'lib/trueandco_analytics/config/params.rb', line 44

def connect_redis
  @connect_redis
end

.current_db_modeObject (readonly)

Returns the value of attribute current_db_mode.



44
45
46
# File 'lib/trueandco_analytics/config/params.rb', line 44

def current_db_mode
  @current_db_mode
end

.sidekiq_configure_client_urlObject (readonly)

Returns the value of attribute sidekiq_configure_client_url.



44
45
46
# File 'lib/trueandco_analytics/config/params.rb', line 44

def sidekiq_configure_client_url
  @sidekiq_configure_client_url
end

.sidekiq_configure_namespaceObject (readonly)

Returns the value of attribute sidekiq_configure_namespace.



44
45
46
# File 'lib/trueandco_analytics/config/params.rb', line 44

def sidekiq_configure_namespace
  @sidekiq_configure_namespace
end

.sidekiq_configure_server_urlObject (readonly)

Returns the value of attribute sidekiq_configure_server_url.



44
45
46
# File 'lib/trueandco_analytics/config/params.rb', line 44

def sidekiq_configure_server_url
  @sidekiq_configure_server_url
end

.time_dead_sessionObject (readonly)

Returns the value of attribute time_dead_session.



44
45
46
# File 'lib/trueandco_analytics/config/params.rb', line 44

def time_dead_session
  @time_dead_session
end

.time_surveyObject (readonly)

Returns the value of attribute time_survey.



44
45
46
# File 'lib/trueandco_analytics/config/params.rb', line 44

def time_survey
  @time_survey
end

Class Method Details

.attr_writer_only_once(*args) ⇒ Object



32
33
34
35
36
37
38
39
40
41
42
# File 'lib/trueandco_analytics/config/params.rb', line 32

def self.attr_writer_only_once(*args)
  args.each do |arg|
    self.send(:define_method, "#{arg}=".intern) do |value|
      return if value.nil?
      return if instance_variable_get("@#{arg}_check")
      return unless value.present?
      instance_variable_set("@#{arg}", value)
      instance_variable_set("@#{arg}_check", true)
    end
  end
end

.logObject



68
69
70
71
# File 'lib/trueandco_analytics/config/params.rb', line 68

def log
  return unless @log_check
  @log
end

.log=(value) ⇒ Object



73
74
75
76
77
# File 'lib/trueandco_analytics/config/params.rb', line 73

def log=(value)
  return if value.nil?
  @log = value.chomp('.log') unless @log_check
  @log_check = true
end

.log_objObject



79
80
81
82
# File 'lib/trueandco_analytics/config/params.rb', line 79

def log_obj
  return unless @log_check
  TrueandcoAnalytics::Logger.instance
end

.set_params {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



28
29
30
# File 'lib/trueandco_analytics/config/params.rb', line 28

def set_params
  yield self  if block_given?
end

.user_methodObject



58
59
60
61
62
63
64
65
66
# File 'lib/trueandco_analytics/config/params.rb', line 58

def user_method
  emulation_user = OpenStruct.new(id: nil, name: '', email: '')
  return emulation_user unless @user_method_check
  begin
    ::ApplicationController.new.send(@user_method)
  rescue StandardError => e
    emulation_user
  end
end