Skip to content

Commit e9f4f64

Browse files
committed
Add Show Public Methods With Pry as a ruby til
1 parent 39f6402 commit e9f4f64

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ _310 TILs and counting..._
238238
- [Returning With Sequel](ruby/returning-with-sequel.md)
239239
- [Safe Navigation Operator](ruby/safe-navigation-operator.md)
240240
- [Set RVM Default Ruby](ruby/set-rvm-default-ruby.md)
241+
- [Show Public Methods With Pry](ruby/show-public-methods-with-pry.md)
241242
- [Squeeze Out The Extra Space](ruby/squeeze-out-the-extra-space.md)
242243
- [Summing Collections](ruby/summing-collections.md)
243244
- [Uncaught Exceptions In Pry](ruby/uncaught-exceptions-in-pry.md)
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Show Public Methods With Pry
2+
3+
Open up a [`pry`](https://github.com/pry/pry) session and use the `-m` flag
4+
with the `ls` command to show just the public methods for an object.
5+
6+
```ruby
7+
> ls -m :hello
8+
Comparable#methods: < <= > >= between?
9+
Symbol#methods:
10+
<=> as_json empty? length slice to_sym
11+
== capitalize encoding match succ upcase
12+
=== casecmp id2name next swapcase
13+
=~ downcase inspect pretty_print_cycle to_proc
14+
[] duplicable? intern size to_s
15+
```
16+
17+
[source](https://github.com/pry/pry/wiki/State-navigation#Ls)

0 commit comments

Comments
 (0)