Skip to content

Instantly share code, notes, and snippets.

@jdhuntington
Created April 2, 2014 19:38
Show Gist options
  • Save jdhuntington/9941523 to your computer and use it in GitHub Desktop.
Save jdhuntington/9941523 to your computer and use it in GitHub Desktop.
my_user = {
:user => {
:name => {
:first => 'JD'
}
},
:object => nil
}
process_user(my_user)
def process_user(thing)
process_name thing[:name]
end
def process_name(the_name)
check_first(the_name[:first])
check_last(the_name)
end
def check_last(last_name)
if(last_name.is_a?(Hash))
last_name[:last].reverse
else
last_name.reverse
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment