Skip to content

Instantly share code, notes, and snippets.

@Bartuz
Created November 25, 2016 07:15
Show Gist options
  • Save Bartuz/6d8e8ba5e7bdf1410d30c41286bf995c to your computer and use it in GitHub Desktop.
Save Bartuz/6d8e8ba5e7bdf1410d30c41286bf995c to your computer and use it in GitHub Desktop.
refactoring
#before
def initialize(options = {})
@type = options.fetch(:destination_type) { CARD_TO_CARD }
@options = options
end
#after
def initialize(destination_type: CARD_TO_CARD, **options)
@type = destination_type
@options = options
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment