annotations - Ruby notation conventions -
when writing ruby code use:
dog
represent dog class#bark
represent instance method.new
or::new
represent class method
what's convention representing instance of class? dog
blend right in surrounding regular text.
that sounds right. in smalltalk, customary use anarray
, astring
or adog
(even parameter names in method declarations), translate an_array
, a_string
or a_dog
. however, that's not customary, , might strange experienced rubyist, expect see ary
, str
, dog
.
note in general, dot only used in code examples actual method calls. when talking about method, always use #
, ::
instance methods , singleton methods.
Comments
Post a Comment