Skip to content

Instantly share code, notes, and snippets.

@harrifeng
Created November 5, 2014 10:23
Show Gist options
  • Save harrifeng/39cfac1ffbfe77c8836f to your computer and use it in GitHub Desktop.
Save harrifeng/39cfac1ffbfe77c8836f to your computer and use it in GitHub Desktop.
def test(*arr)
arr.each do |a|
puts "a is #{a}, #{a.class}"
end
end
test :title, :description, :image_url, presence: true
##################################################
# <===================OUTPUT===================> #
# a is title, Symbol #
# a is description, Symbol #
# a is image_url, Symbol #
# a is {:presence=>true}, Hash #
##################################################
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment