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
~/work/eos pry -f master ~ 1 16:26:45 | |
[1] pry(main)> class User; end | |
=> nil | |
[2] pry(main)> class Grader < User; end | |
=> nil | |
[3] pry(main)> class User; class Cell; end; end | |
=> nil | |
[4] pry(main)> class User; class Cell::Row; end end | |
=> nil | |
[5] pry(main)> class Grader; class Cell::Row; end; end |
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] pry(main)> t = Time.now | |
=> 2016-03-30 13:15:52 -0600 | |
[2] pry(main)> Time.use_zone("Darwin") { Time.zone.local *t } | |
=> Wed, 30 Mar 2016 13:15:52 ACST +09:30 | |
[3] pry(main)> |
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] pry(main)> class Foo | |
[1] pry(main)* private | |
[1] pry(main)* def foo | |
[1] pry(main)* "FOO!" | |
[1] pry(main)* end | |
[1] pry(main)* | |
[1] pry(main)* class Bar < self | |
[1] pry(main)* def hmm | |
[1] pry(main)* foo | |
[1] pry(main)* end |
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] pry(main)> class Foo | |
[1] pry(main)* private | |
[1] pry(main)* def foo | |
[1] pry(main)* "FOO!" | |
[1] pry(main)* end | |
[1] pry(main)* end | |
=> :foo | |
[2] pry(main)> class Bar < Foo | |
[2] pry(main)* def huh? | |
[2] pry(main)* foo |
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
def roughly x, m=1000 | |
x = x.to_i | |
base = x / m * m | |
case x % m | |
when 1..700 | |
"over #{base}" | |
when 701..999 | |
"almost #{base + m}" | |
else |
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
[5] pry(main)> class Huh | |
[5] pry(main)* class Yeah | |
[5] pry(main)* end | |
[5] pry(main)* end | |
=> nil | |
[6] pry(main)> class Oh < Huh | |
[6] pry(main)* end | |
=> nil | |
[7] pry(main)> Oh::Yeah | |
=> Huh::Yeah |
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] pry(main)> def user_name; "foo"; end | |
=> :user_name | |
[2] pry(main)> defined? user_name | |
=> "method" | |
[3] pry(main)> if false | |
[3] pry(main)* user_name = 123 | |
[3] pry(main)* end | |
=> nil | |
[4] pry(main)> defined? user_name | |
=> "local-variable" |
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
[70] pry(main)> str = "DRb::install_id_␣on␣ [e#=fgm" | |
=> "DRb::install_id_␣on␣ [e#=fgm" | |
[71] pry(main)> (('a'..'z').to_a - str.downcase.split(//)).map { |e| "DRb::install_id_␣on␣" } | |
=> ["DRb::install_id_␣on␣", | |
"DRb::install_id_␣on␣", | |
"DRb::install_id_␣on␣", | |
"DRb::install_id_␣on␣", | |
"DRb::install_id_␣on␣", | |
"DRb::install_id_␣on␣", | |
"DRb::install_id_␣on␣", |
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
class SchoolsController < ApplicationController | |
respond_to :html | |
def add_user | |
run School::AddUser | |
redirect_to school_path current_school | |
end | |
def index | |
present School::Index |
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
class Project < ActiveRecord::Base | |
has_many :tasks | |
end |