Ruby In Steel :: Help Index :: SapphireSteel Software Front Page Return to the Index
Automating Type Assertions
See Also

Glossary Item Box

You can add a type assertion comment block over a method by entering two # characters on a blank line above the method. For example, let's assume you have this method:

def addName( names, aName  )
     return names << aName
end

If you enter ## onto the line above this method, Ruby In Steel will automatically insert the following comment block:

 #:return: => Object
 #:arg: names => Object
 #:arg: aName => Object

You may now edit this to show the desired types. For example:

 #:return: => Array
 #:arg: names => Array
 #:arg: aName => String

Those types will now be displayed by IntelliSense.

See Also

IntelliSense
Type Assertions