rubydbc
gem install rubydbc
Labels: ruby
martin's weblog
Labels: ruby
Labels: ruby
irb(main):006:0> def test
irb(main):007:1> p current_method
irb(main):008:1> end
=> nil
irb(main):009:0> test
:test
=> nil
irb(main):010:0>
Labels: ruby
Labels: ruby
Labels: ruby
Labels: ruby
irb(main):001:0> class A
irb(main):002:1> @a = 10
irb(main):003:1> def a
irb(main):004:2> return @a
irb(main):005:2> end
irb(main):006:1> end
=> nil
irb(main):007:0> A.new.a
=> nil
irb(main):001:0> class A
irb(main):002:1> @a = 10
irb(main):003:1> def A.a
irb(main):004:2> return @a
irb(main):005:2> end
irb(main):006:1> end
=> nil
irb(main):007:0> A.a
=> 10
Labels: ruby
(5 + 4) * (10 - 2) / 3
^Z
24.0
Labels: ruby
Following the type character is a delimiter, which can be any nonalphabetic or nonmultibyte
character. If the delimiter is one of the characters (, [, {, or <, the literal
consists of the characters up to the matching closing delimiter, taking account of nested
delimiter pairs. For all other delimiters, the literal comprises the characters up to the
next occurrence of the delimiter character.
Labels: ruby
Labels: ruby
Labels: ruby
Labels: ruby
If it walks like a duck and quacks like a duck, then it must be a duck.
Labels: ruby
The important thing to remember about Ruby is that there isn't a big difference between “compile time” and “runtime.” It's all the same. You can add code to a running process. You can redefine methods on the fly, change their scope from public to private, and so on. You can even alter basic types, such as Class and Object.
Labels: ruby
Labels: ruby