Skip to content

Instantly share code, notes, and snippets.

@namncn
Created January 18, 2017 11:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save namncn/2db111e8cc77a5c19024c11413cd44cf to your computer and use it in GitHub Desktop.
Save namncn/2db111e8cc77a5c19024c11413cd44cf to your computer and use it in GitHub Desktop.
> IRB
2.2.0: 001> require './math'
=> Đúng
2.2.0: 002> multiply_by_two 2
=> 4
2.2.0: 003> multiply_by_two -2
=> -4
2.2.0: 004> multiply_by_two
ArgumentError: Xin cung cấp một số hợp lệ
from /Users/bill/dev/math.rb:3:in 'multiply_by_two'
from (IRB): 4
from /Users/bill/.rvm/rubies/ruby-2.2.0/bin/irb:11:in `<main>'
2.2.0: 005> multiply_by_two "ruby"
ArgumentError: Xin cung cấp một số hợp lệ
from /Users/bill/dev/math.rb:3:in 'multiply_by_two'
from (IRB): 5
from /Users/bill/.rvm/rubies/ruby-2.2.0/bin/irb:11:in `<main> '
2.2.0: 006> multiply_by_two nil
ArgumentError: Xin cung cấp một số hợp lệ
from /Users/bill/dev/math.rb:3:in 'multiply_by_two'
from (IRB): 6
from /Users/bill/.rvm/rubies/ruby-2.2.0/bin/irb:11:in `<main> '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment