This file contains hidden or 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
| mclovin = { | |
| "Name" => "McLOVIN", | |
| "City" => "HONOLULU", | |
| "DOB" => "06/03/1981", | |
| "Address" => { | |
| "Street" => "892 MOMONA ST", | |
| "City" => "HONOLULU", | |
| "State" => "HI", | |
| "Zip" => "96820" | |
| }, |
This file contains hidden or 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
| mclovin = { | |
| "Name" => "McLOVIN", | |
| "City" => "HONOLULU", | |
| "DOB" => "06/03/1981" | |
| } | |
| >> mclovin["Name"] | |
| => "McLOVIN" | |
| >> mclovin["City"] |
This file contains hidden or 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
| $ gem list | |
| *** LOCAL GEMS *** | |
| redcarpet (2.1.1) | |
| sinatra (1.3.3) |
This file contains hidden or 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
| $ gem install twitter | |
| Fetching: multipart-post-1.1.5.gem (100%) | |
| Fetching: faraday-0.8.4.gem (100%) | |
| Fetching: simple_oauth-0.1.9.gem (100%) | |
| Fetching: twitter-3.7.0.gem (100%) | |
| Successfully installed multipart-post-1.1.5 | |
| Successfully installed faraday-0.8.4 | |
| Successfully installed simple_oauth-0.1.9 | |
| Successfully installed twitter-3.7.0 |
This file contains hidden or 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
| >> require 'twitter' | |
| => true |
This file contains hidden or 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
| >> client = Twitter::Client.new | |
| => #<Twitter::Client:0x007f90aa988ba8 ... lots of stuff ... @attrs={}>> |
This file contains hidden or 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
| >> results = client.search("#iphone5") | |
| => #<Twitter::SearchResults:0x007f90aaab7970 ... YIKES ... :since_id_str=>"0"}> |
This file contains hidden or 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
| >> results.completed_in | |
| => 0.332 | |
| >> results.max_id | |
| => 246008041437294592 | |
| >> results.next_page | |
| => "?page=2&max_id=246008041437294592&q=%23iphone5" | |
| >> results.page | |
| => 1 | |
| >> results.query | |
| => "%23iphone5" |
This file contains hidden or 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
| >> results.results.class | |
| => Array | |
| >> results.results.count | |
| => 15 | |
| >> results.results[0] | |
| => #<Twitter::Tweet:0x007f90aa97d2d0 ... :to_user_name=>nil}> | |
| >> tweet = results.results[0] | |
| => #<Twitter::Tweet:0x007f90aa97d2d0 ... :to_user_name=>nil}> | |
| >> tweet.text | |
| => "#WTF where is the #NFC ship ? #iPhone #iPhone5 #Apple" |
This file contains hidden or 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 + 2 # => 3 | |
| >> 2 - 1 # => 1 | |
| >> 2 * 5 # => 10 | |
| >> 10 % 3 # => 1 | |
| >> 10 ** 3 # => 1000 | |
| >> 10 / 3 # => 3 | |
| >> ((5 * 2) - 2) # => 8 | |
| >> (5 * (2 - 2)) # => 0 |