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)> require 'pg' | |
=> true | |
[2] pry(main)> db = PG.connect(dbname: 'lesson_4') | |
=> #<PG::Connection:0x007f9701eb2950> | |
[3] pry(main)> results = db.exec('SELECT * FROM films;') | |
=> #<PG::Result:0x007f9705bdb908 status=PGRES_TUPLES_OK ntuples=10 nfields=6 cmd_tuples=10> | |
[4] pry(main)> results.fields | |
=> ["title", "year", "genre", "duration", "director_id", "id"] | |
[5] pry(main)> results.values | |
=> [["Die Hard", "1988", "action", "132", "1", "1"], |
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
module Hands | |
# Actions is mixed into Hand class | |
# @cards is a Hand instance variable that is an array of Card objects | |
module Actions | |
def hit(stock) | |
def double(stock) | |
def split(player, stock) | |
end | |
module Compare |
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
module Jekyll | |
class Document | |
#Updated for Jekyll 3.0.0 | |
# override post method in order to return categories names as slug | |
# instead of strings | |
# | |
# An url for a post with category "category with space" will be in |