Skip to content

Instantly share code, notes, and snippets.

@indigoviolet
Created December 23, 2017 15:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save indigoviolet/0736c83022b5fe6c91dafe683be9114e to your computer and use it in GitHub Desktop.
Save indigoviolet/0736c83022b5fe6c91dafe683be9114e to your computer and use it in GitHub Desktop.
fin blog embed
class KeywordStruct < Struct
def clone
params = self.to_h
params = params.tap { |f| yield(f) } if block_given?
self.class.new(**params)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment