Skip to content

Instantly share code, notes, and snippets.

@caius
Created May 11, 2018 15:26
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 caius/67860a61d5238cffca0d350ddce48ce0 to your computer and use it in GitHub Desktop.
Save caius/67860a61d5238cffca0d350ddce48ce0 to your computer and use it in GitHub Desktop.
module FetchDup
def fetch(*)
super.dup
end
end
html_options = {
:class => "one",
}
html_options.extend(FetchDup).fetch(:class).concat(" fred") # => "one fred"
html_options # => {:class=>"one"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment