Skip to content

Refactor API key to the module #1

@excid3

Description

@excid3

What are your thoughts on changing this:

find = InfoconnectWrapper::FindCompany.new
key = '' #your api key..."
find.init(key)
company = find.find_by_name('Infogroup', 'Papillion', 'NE', 'Enhanced')

To this:

# config/initializers/infoconnect.rb
InfoconnectWrapper.api_key = "YOUR_API_KEY"
# inside your app
company = InfoconnectWrapper::FindCompany.new.find_by_name("Infogroup", "Papillion", "NE", "Enhanced")

Unless you've got the need to change the key each request, I'd propose setting it up this way. Happy to do a PR for it as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions