Created
March 29, 2016 19:02
-
-
Save kiefer136/c71340eceb26e224846b84bfe83c174f to your computer and use it in GitHub Desktop.
My Ruby Kiefer Johnson
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[1] pry(main)> 5 + 10 | |
=> 15 | |
[2] pry(main)> REPL | |
NameError: uninitialized constant REPL | |
from (pry):2:in `__pry__' | |
[3] pry(main)> def say_hi(name) | |
[3] pry(main)* def say_hi(Josh) | |
[3] pry(main)* | |
[3] pry(main)> def say_hi(name) | |
[3] pry(main)* "hi #{name}" | |
[3] pry(main)* end | |
=> :say_hi | |
[4] pry(main)> say_hi("Josh") | |
=> "hi Josh" | |
[5] pry(main)> my_array = [5, 35, 2, 16] | |
=> [5, 35, 2, 16] | |
[6] pry(main)> my_array.sort | |
=> [2, 5, 16, 35] | |
[7] pry(main)> my_array\ | |
[7] pry(main)* my_array\ | |
[7] pry(main)* | |
[7] pry(main)> | |
[8] pry(main)> my_array\ | |
[8] pry(main)* | |
[8] pry(main)> my_array | |
=> [5, 35, 2, 16] | |
[9] pry(main)> my_array = [5, 35, 2, 16] | |
=> [5, 35, 2, 16] | |
[10] pry(main)> my_array.sort | |
=> [2, 5, 16, 35] | |
[11] pry(main)> my_array | |
=> [5, 35, 2, 16] | |
[12] pry(main)> my_array.sort! | |
=> [2, 5, 16, 35] | |
[13] pry(main)> | |
[14] pry(main)> my_array | |
=> [2, 5, 16, 35] | |
[15] pry(main)> an_array = ['temmo', 'cats', 'doges', 'beears'] | |
=> ["temmo", "cats", "doges", "beears"] | |
[16] pry(main)> an_array.each | |
=> #<Enumerator: ...> | |
[17] pry(main)> | |
[18] pry(main)> 444 | |
=> 444 | |
[19] pry(main)> | |
[20] pry(main)> an_array.each { |word| puts word} | |
temmo | |
cats | |
doges | |
beears | |
=> ["temmo", "cats", "doges", "beears"] | |
[21] pry(main)> Math.sqrt(1282) | |
=> 35.805027579936315 | |
[22] pry(main)> Time.now | |
=> 2016-03-29 11:59:26 -0700 | |
[23] pry(main)> Array.new(10, 'bee') | |
=> ["bee", "bee", "bee", "bee", "bee", "bee", "bee", "bee", "bee", "bee"] | |
[24] pry(main)> include Math | |
=> Object | |
[25] pry(main)> sqrt 68 | |
=> 8.246211251235321 | |
[26] pry(main)> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment