What is the ruby main method?


 
Thread Tools Search this Thread
Top Forums Programming What is the ruby main method?
# 1  
Old 12-09-2014
What is the ruby main method?

I am trying to obtain documentation using ri on my local machine. If I dont require any method in my script and I want to find information on .value or .inspect or anything that is native without calling in a method how can I look that up with ri, or even rdoc?
# 2  
Old 02-14-2015
If you just search on the method name, you should get a list of all the objects that have it:

Code:
$ ri value
= .value

(from ruby core)
=== Implementation from Cookie
------------------------------------------------------------------------------
  value()

------------------------------------------------------------------------------

Returns the value or list of values for this cookie.
[more]

All objects have a base class of Object so you can get more specific, too:

Code:
$ ri Object.inspect
= Object.inspect

(from ruby core)
------------------------------------------------------------------------------
  obj.inspect   -> string

------------------------------------------------------------------------------

Returns a string containing a human-readable representation of obj. By
default, show the class name and the list of the instance variables and their
values (by calling #inspect on each of them). User defined classes should
override this method to make better representation of obj.  When
overriding this method, it should return a string whose encoding is compatible
with the default external encoding.
[more]

Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. What is on Your Mind?

Ruby language

Hi All, Could you please suggest books for learning ruby and python language ? Thanks, Pravin (1 Reply)
Discussion started by: pravin27
1 Replies

2. Solaris

svc:/network/physical:default: Method "/lib/svc/method/net-physical" failed with exit status 96. [ n

After a memory upgrade all network interfaces are misconfigued. How do i resolve this issue. Below are some out puts.thanks. ifconfig: plumb: SIOCLIFADDIF: eg000g0:2: no such interface # ifconfig eg1000g0:2 plumb ifconfig: plumb: SIOCLIFADDIF: eg1000g0:2: no such interface # ifconfig... (2 Replies)
Discussion started by: andersonedouard
2 Replies

3. Shell Programming and Scripting

$? and main return value

It seems $? can only contain one byte. see below: int main() { return 0x12345678; } After I run the code and check the $? value it output 120, obviously it is the decimal of the last byte of 0x12345678. And if I return a value less than 255, the $? value seems right. Why? and... (3 Replies)
Discussion started by: vistastar
3 Replies

4. Shell Programming and Scripting

What is Ruby?

Lately there have been a lot of one-liners posted in "ruby" on the apparent assumption that mainstream unix or Linux come with "ruby. They don't. What is "ruby"? What platforms and Operating System versions are supported? The syntax for "ruby" seems remarkably obscure compared with say "awk"... (13 Replies)
Discussion started by: methyl
13 Replies

5. UNIX and Linux Applications

Sendmail: help with main.mc

We compile the sendmail.cf file using main.mc. I have managed to place all of our configuration options in main.mc without a problem, with the exception of one. I want to have the HelpFile commented out by default in sendmail.cf. How can I instruct main.mc to place an entry for HelpFile in... (1 Reply)
Discussion started by: dangral
1 Replies

6. Programming

main function

Is it possible to execute any function before main() function in C or C++. (6 Replies)
Discussion started by: arun.viswanath
6 Replies

7. UNIX for Dummies Questions & Answers

main makefile

hello everyone.. am having problem with my so-called main makefile all my files are in the same folder, i was planning to make a single makefile that would make two executable but I got some errors so I separated them and used now i was wondering if I could create a single makefile... (6 Replies)
Discussion started by: ideur
6 Replies

8. Programming

Main Resursive is it possible

Friends I am Trying this code to call main Recursively But It is showing segmentation errot #include<stdio.h> int main() { int i; for(i=0;i<10;i++) { if(i==5) { exit(0); } else { main(); } } } (7 Replies)
Discussion started by: krishna_sicsr
7 Replies
Login or Register to Ask a Question