Skip to content

Instantly share code, notes, and snippets.

Created July 9, 2016 12:19
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 anonymous/f2f7831fe40e4ec72ac6a584baf91341 to your computer and use it in GitHub Desktop.
Save anonymous/f2f7831fe40e4ec72ac6a584baf91341 to your computer and use it in GitHub Desktop.
hash_creation.rb
# {:media_id=>[470030289822314497], :alt_text=>{:text=>["foo"]}}
def add_alt_text_to_media(media_id, alt_text, options = {})
hash = options.dup
hash[:media_id] = media_id
hash[:alt_text] = {}
hash[:alt_text][:text] = alt_text
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment