Class: GaTrackable::Configuration

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Validations
Defined in:
lib/ga_trackable/configuration.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize {|_self| ... } ⇒ Configuration

Returns a new instance of Configuration.

Yields:

  • (_self)

Yield Parameters:



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/ga_trackable/configuration.rb', line 32

def initialize
  @view_id = ENV['GA_TRACKABLE_VIEW_ID']
  @app_name = ENV['GA_TRACKABLE_APP_NAME']
  @app_version = ENV['GA_TRACKABLE_APP_VERSION']
  @secret_path = ENV['GA_TRACKABLE_SECRET_PATH']
  @secret_key = ENV['GA_TRACKABLE_KEY_SECRET']
  @scope = ENV['GA_TRACKABLE_SCOPE']
  @issuer_email = ENV['GA_TRACKABLE_ISSUER_EMAIL']
  @page_views_white_filter = ENV['GA_TRACKABLE_PAGEVIEWS_WHITE_FILTER']
  @page_views_black_filter = ENV['GA_TRACKABLE_PAGEVIEWS_BLACK_FILTER']
  @out = STDOUT
  @video_url_base = []

  yield(self) if block_given?

  @rails_env = @rails_env.to_sym

  [
    @view_id,
    @app_name,
    @app_version,
    @secret_path,
    @secret_key,
    @scope,
    @issuer_email,
    @page_views_white_filter,
    @page_views_black_filter,
    @video_url_base
  ].each(&:freeze)
end

Class Method Details

.attribute_namesObject



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

def self.attribute_names
  i(app_name app_version secret_path secret_key scope issuer_email view_id page_views_black_filter page_views_white_filter page_views_entity_fetcher video_plays_entity_fetcher out exceptions_handler video_url_base rails_env)
end

Instance Method Details

#attribute_namesObject



13
14
15
# File 'lib/ga_trackable/configuration.rb', line 13

def attribute_names
  self.class.attribute_names
end