[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

How to Read Ruby API / Documentation

Chinna Karuppan

3/14/2008 4:13:00 PM

Hi,
I have some background in java.and the api is nicely defined...in terms
of what is public,protected and private.I was trying to use the
define_method in one of my class and it would not work because it is
private(but that is not point here.the point how to know which all
methods are for public use and which is protected and which is
private--> not for consumers of the library)...can some body tell as to
how to read the api ( I am using http://www.ruby-doc...) or am I
missing something???
THnks
CHinna
--
Posted via http://www.ruby-....

12 Answers

Chinna Karuppan

3/14/2008 4:15:00 PM

0

I know there are methods like private_methods, protected_methods,
instance_methods.I don't want to everytime call these methods...
Also How do I know which is a instance method/ class method....don't
tell me :: is the class method and #/. is the instance method.Why does
it not show properly on the API...
THnks

Chinna Karuppan wrote:
> Hi,
> I have some background in java.and the api is nicely defined...in terms
> of what is public,protected and private.I was trying to use the
> define_method in one of my class and it would not work because it is
> private(but that is not point here.the point how to know which all
> methods are for public use and which is protected and which is
> private--> not for consumers of the library)...can some body tell as to
> how to read the api ( I am using http://www.ruby-doc...) or am I
> missing something???
> THnks
> CHinna

--
Posted via http://www.ruby-....

7stud --

3/14/2008 4:39:00 PM

0

You will have to get used to the fact that the Ruby docs are horrible.
--
Posted via http://www.ruby-....

James Britt

3/14/2008 4:50:00 PM

0

7stud -- wrote:
> You will have to get used to the fact that the Ruby docs are horrible.


Patches welcome.



--
James Britt

"MVC applies to the Web about as well as RPC does."
- Bill de hOra

Gregory Seidman

3/14/2008 5:03:00 PM

0

On Sat, Mar 15, 2008 at 01:39:00AM +0900, 7stud -- wrote:
> You will have to get used to the fact that the Ruby docs are horrible.

The *free* Ruby docs leave something to be desired. The Pickaxe book is
pretty good in a lot of ways, and I've also gotten a lot of value out of
the O'Reilly Ruby Pocket Reference I won at RubyConf.

Beyond that, Foo.instance_methods.grep(/bar/) is your friend. Playing
around in irb is invaluable. I even look things up in ri occasionally. The
wealth of expertise available on this mailing list and on #ruby-lang on
freenode.net have also helped me a great deal. And Google is always your
friend.

Complaining that the free documentation for the free (and Free)
language/platform you're using leaves something to be desired is absurd.
Feel free to contribute better documentation if you think it's a good use
of your time. (Saying it's worth someone else's time but not your own is
the height of hypocrisy unless you're willing to pay money for that other
person's time.) Otherwise, use the other resources available to you.

--Greg


7stud --

3/14/2008 6:20:00 PM

0

James Britt wrote:
> 7stud -- wrote:
>> You will have to get used to the fact that the Ruby docs are horrible.
>
>
> Patches welcome.
>
>

Open up the docs to user comments, and then they will be self
documenting. See the php model.
--
Posted via http://www.ruby-....

Phillip Gawlowski

3/14/2008 6:40:00 PM

0

7stud -- wrote:
> James Britt wrote:
>> 7stud -- wrote:
>>> You will have to get used to the fact that the Ruby docs are horrible.
>>
>> Patches welcome.
>>
>>
>
> Open up the docs to user comments, and then they will be self
> documenting. See the php model.

Then host them yourself, and allow user comments.

- Phillip

James Britt

3/14/2008 7:12:00 PM

0

7stud -- wrote:
> James Britt wrote:
>> 7stud -- wrote:
>>> You will have to get used to the fact that the Ruby docs are horrible.
>>
>> Patches welcome.
>>
>>
>
> Open up the docs to user comments, and then they will be self
> documenting. See the php model.

Is that what stops you from contributing to the docs? Or would you
prefer that others make the contributions, while you simply declare them
to be horrible?

There are some people who have taken the time to create and/or improve
the docs. You can bitch about their efforts, but a tangible
contribution would be so much more durable.


(I apologize if you have been sending in doc patches.)

ruby-doc.org is currently running with Nitro; I'm inclined to port it to
Ramaze.

If anyone is interested in helping me assemble a Ramaze-based means of
allowing doc comments, with decent spam blocking, drop me a line. (I
prefer to use Og or Sequel for the ORM, but open to informed suggestions
otherwise.)

Note that the API doc content would still need to be auto-generated from
the svn ruby source and doing so should not interfere with any existing
comments.


--
James Britt

"In physics the truth is rarely perfectly clear, and that is certainly
universally the case in human affairs. Hence, what is not surrounded by
uncertainty cannot be the truth."
- R. Feynman

Chinna Karuppan

3/14/2008 7:34:00 PM

0

I know that a lot of effort is being put by volunteers and appreciate
it.But as for a nuby do you think there is a place I can go to check
which is the list of protected methods , private methods....and probably
other method that I get from its super classes.I use the nobkitt as
well to check the public methods....Am I missing some thing.
Once again Thnks for you efforts.
THnks
Chinna

James Britt wrote:
> 7stud -- wrote:
>> James Britt wrote:
>>> 7stud -- wrote:
>>>> You will have to get used to the fact that the Ruby docs are horrible.
>>>
>>> Patches welcome.
>>>
>>>
>>
>> Open up the docs to user comments, and then they will be self
>> documenting. See the php model.
>
> Is that what stops you from contributing to the docs? Or would you
> prefer that others make the contributions, while you simply declare them
> to be horrible?
>
> There are some people who have taken the time to create and/or improve
> the docs. You can bitch about their efforts, but a tangible
> contribution would be so much more durable.
>
>
> (I apologize if you have been sending in doc patches.)
>
> ruby-doc.org is currently running with Nitro; I'm inclined to port it to
> Ramaze.
>
> If anyone is interested in helping me assemble a Ramaze-based means of
> allowing doc comments, with decent spam blocking, drop me a line. (I
> prefer to use Og or Sequel for the ORM, but open to informed suggestions
> otherwise.)
>
> Note that the API doc content would still need to be auto-generated from
> the svn ruby source and doing so should not interfere with any existing
> comments.
>
>
> --
> James Britt
>
> "In physics the truth is rarely perfectly clear, and that is certainly
> universally the case in human affairs. Hence, what is not surrounded
> by
> uncertainty cannot be the truth."
> - R. Feynman

--
Posted via http://www.ruby-....

Jeremy McAnally

3/14/2008 9:22:00 PM

0

I agree with you.

I'm not sure why people want to learn Ruby in a vacuum or something.
"These docs don't teach me every possible behavior of method (x)!!!!
THESE SUCK!!!!" Get your hands dirty in irb, otherwise you won't
really *learn* how to use it right, IMHO.

Ruby documentation needs help (no I haven't submitted patches to Ruby
but I have submitted a lot to Rails), but hopefully some things that
are being worked on will bring up the ease of doc edits, the quality
of generated documentation, and the quality of documentation content.
We shall see though.

--Jeremy

On Fri, Mar 14, 2008 at 1:02 PM, Gregory Seidman
<gsslist+ruby@anthropohedron.net> wrote:
> On Sat, Mar 15, 2008 at 01:39:00AM +0900, 7stud -- wrote:
> > You will have to get used to the fact that the Ruby docs are horrible.
>
> The *free* Ruby docs leave something to be desired. The Pickaxe book is
> pretty good in a lot of ways, and I've also gotten a lot of value out of
> the O'Reilly Ruby Pocket Reference I won at RubyConf.
>
> Beyond that, Foo.instance_methods.grep(/bar/) is your friend. Playing
> around in irb is invaluable. I even look things up in ri occasionally. The
> wealth of expertise available on this mailing list and on #ruby-lang on
> freenode.net have also helped me a great deal. And Google is always your
> friend.
>
> Complaining that the free documentation for the free (and Free)
> language/platform you're using leaves something to be desired is absurd.
> Feel free to contribute better documentation if you think it's a good use
> of your time. (Saying it's worth someone else's time but not your own is
> the height of hypocrisy unless you're willing to pay money for that other
> person's time.) Otherwise, use the other resources available to you.
>
> --Greg
>
>
>



--
http://jeremymca...
http:...

Read my books:
Ruby in Practice (http://manning.com...)
My free Ruby e-book (http://humblelittlerub...)

Or, my blogs:
http://mrneig...
http://rubyinpr...

Gilbert Rebhan

3/14/2008 9:47:00 PM

0

Jeremy McAnally wrote:
> I'm not sure why people want to learn Ruby in a vacuum or something.
> "These docs don't teach me every possible behavior of method (x)!!!!
> THESE SUCK!!!!" Get your hands dirty in irb, otherwise you won't
> really *learn* how to use it right, IMHO.

+1
learning by doing, as for other languages too :-)
hard work after all for the zapping generation
I know other communities and the ruby community is

premium/super/excellent !!

Every language documentation misses / lacks something.
But from what i know especially the ruby community is
VERY newbie friendly and gets you easily over the first hurdles.
There are so many blogs, tutorials and docs around ...

And when you're @ high level some sunny day, just pass
it back to others, just starting or still learning.
Take and give :-)

Regards, Gilbert