Skip to content

Commit 73769f1

Browse files
committed
Fix lint issues
1 parent 0165dee commit 73769f1

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

lib/optimizely/event/event_factory.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ def create_log_event(user_events, logger)
7272
builder.with_visitors(visitors)
7373
event_batch = builder.build
7474

75-
ENDPOINT = ENDPOINTS[user_context[:region].to_sym] || ENDPOINTS[:US]
75+
endpoint = ENDPOINTS[user_context[:region].to_sym] || ENDPOINTS[:US]
7676

77-
Event.new(:post, ENDPOINT, event_batch.as_json, POST_HEADERS)
77+
Event.new(:post, endpoint, event_batch.as_json, POST_HEADERS)
7878
end
7979

8080
def build_attribute_list(user_attributes, project_config)

lib/optimizely/event_builder.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,9 @@ def create_impression_event(project_config, experiment, variation_id, user_id, a
130130
impression_params = get_impression_params(project_config, experiment, variation_id)
131131
event_params[:visitors][0][:snapshots].push(impression_params)
132132

133-
ENDPOINT = ENDPOINTS[region]
133+
endpoint = ENDPOINTS[region]
134134

135-
Event.new(:post, ENDPOINT, event_params, POST_HEADERS)
135+
Event.new(:post, endpoint, event_params, POST_HEADERS)
136136
end
137137

138138
def create_conversion_event(project_config, event, user_id, attributes, event_tags)
@@ -151,9 +151,9 @@ def create_conversion_event(project_config, event, user_id, attributes, event_ta
151151
conversion_params = get_conversion_params(event, event_tags)
152152
event_params[:visitors][0][:snapshots] = [conversion_params]
153153

154-
ENDPOINT = ENDPOINTS[region]
154+
endpoint = ENDPOINTS[region]
155155

156-
Event.new(:post, ENDPOINT, event_params, POST_HEADERS)
156+
Event.new(:post, endpoint, event_params, POST_HEADERS)
157157
end
158158

159159
private

spec/config/datafile_project_config_spec.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -763,15 +763,15 @@
763763
end
764764

765765
it 'should parse region specified in datafile correctly' do
766-
project_configUS = Optimizely::DatafileProjectConfig.new(config_body_JSON, logger, error_handler)
767-
expect(project_config.region).to eq('US')
766+
project_config_us = Optimizely::DatafileProjectConfig.new(config_body_JSON, logger, error_handler)
767+
expect(project_config_us.region).to eq('US')
768768

769-
config_bodyEU = config_body.dup
770-
config_bodyEU['region'] = 'EU'
771-
config_body_JSON = JSON.dump(config_bodyEU)
772-
project_configEU = Optimizely::DatafileProjectConfig.new(config_body_JSON, logger, error_handler)
769+
config_body_eu = config_body.dup
770+
config_body_eu['region'] = 'EU'
771+
config_body_json = JSON.dump(config_body_eu)
772+
project_config_eu = Optimizely::DatafileProjectConfig.new(config_body_json, logger, error_handler)
773773

774-
expect(project_config.region).to eq('EU')
774+
expect(project_config_eu.region).to eq('EU')
775775
end
776776

777777
it 'should initialize properties correctly upon creating project with typed audience dict' do

0 commit comments

Comments
 (0)