Skip to content

Instantly share code, notes, and snippets.

@kdefliese
Created October 1, 2015 00:02
Show Gist options
  • Save kdefliese/228620e7aacdaeb6002a to your computer and use it in GitHub Desktop.
Save kdefliese/228620e7aacdaeb6002a to your computer and use it in GitHub Desktop.
Example to show how to use the awesome-print gem
require "awesome_print"
my_string = "Hello there"
my_array = [1,2,3,4,5,6,"cats",false]
my_hash = {
first_name: "Team",
last_name: "Awesome-Print",
cohort: 4,
student_status: true
}
puts "Here is everything normally printed:"
puts my_string
puts my_array
puts my_hash
puts "Here is everything awesomely printed!"
ap my_string
ap my_array
ap my_hash
puts "Here is everything awesomely printed with options!"
ap my_string, :color => {:string => :red}
ap my_array, :indent => 10
ap my_hash, :indent => 10, :color => {:string => :red, :fixnum => :red, :trueclass => :red}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment