Skip to content

refact: Updates OptimizelyFactory methods. #183

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jul 19, 2019

Conversation

rashidsp
Copy link
Contributor

@rashidsp rashidsp commented Jul 18, 2019

Summary

# Returns a new optimizely instance.
#
# @param config_manager - Required ConfigManagerInterface Responds to get_config.
def self.default_instance_with_manager(config_manager)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With config_manager

# @param user_profile_service - Optional UserProfileServiceInterface which provides methods to store and retreive user profiles.
# @param skip_json_validation - Optional Boolean param to skip JSON schema validation of the provided datafile.
# @param notification_center - Optional Instance of NotificationCenter.
def self.custom_instance_with_manager(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this is not needed. Let's keep it out until a customer asks for it. I don't see too much value in supporting this.

@rashidsp rashidsp requested a review from mikeproeng37 July 18, 2019 18:55
event_dispatcher = nil,
logger = nil,
error_handler = nil,
skip_json_validation = false,
user_profile_service = nil,
sdk_key = nil,
config_manager = nil,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should keep this config manager and pass it along to the constructor. We just shouldn't make it mandatory, default it to nil

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.0008%) to 99.544% when pulling 6cbb0f2 on rashid/refact-optly-factory into ba7d0cc on master.

@coveralls
Copy link

coveralls commented Jul 19, 2019

Coverage Status

Coverage decreased (-0.02%) to 99.521% when pulling fae6913 on rashid/refact-optly-factory into ba7d0cc on master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.0008%) to 99.544% when pulling 6cbb0f2 on rashid/refact-optly-factory into ba7d0cc on master.

@rashidsp rashidsp requested a review from mikeproeng37 July 19, 2019 08:19
# @param notification_center - Optional Instance of NotificationCenter.
def self.custom_instance(
sdk_key,
fallback = nil,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Externally, this should still be called datafile. Internally, we can call it fallback.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, yeah this is a named parameter so I think we should just call it datafile and in the doc param we can call it the fallback datafile. I don't like the idea of introducing yet another name/concept for it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mikeng13 Done

Copy link
Contributor

@mikeproeng37 mikeproeng37 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mikeproeng37 mikeproeng37 merged commit 19a3599 into master Jul 19, 2019
@rashidsp rashidsp deleted the rashid/refact-optly-factory branch July 19, 2019 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants