# _M.ruby

The ruby module.
It provides utilities for editing Ruby code.

## Key Bindings

+ `Ctrl+L, M` (`⌘L, M` on Mac OSX | `M-L, M` in curses)
  Open this module for editing.
+ `Shift+Enter` (`⇧↩` | `S-Enter`)
  Try to autocomplete an `if`, `while`, `for`, etc. control structure with
  `end`.
+ `.`
  When to the right of a known symbol, show an autocompletion list of fields
  and functions.
+ `::`
  When to the right of a known symbol, show an autocompletion list of fields
  and functions.

- - -

## Fields

- - -

<a id="sense"></a>
### `sense` 

The Ruby [Adeptsense](_M.textadept.adeptsense.html).
  It loads user tags from *`_USERHOME`/modules/ruby/tags* and user apidocs
  from *`_USERHOME`/modules/ruby/api*.

- - -


## Functions

- - -

<a id="toggle_block"></a>
### `toggle_block`()

Toggles between `{ ... }` and `do ... end` Ruby blocks.
If the caret is inside a `{ ... }` single-line block, that block is converted
to a multiple-line `do .. end` block. If the caret is on a line that contains
single-line `do ... end` block, that block is converted to a single-line
`{ ... }` block. If the caret is inside a multiple-line `do ... end` block,
that block is converted to a single-line `{ ... }` block with all newlines
replaced by a space. Indentation is important. The `do` and `end` keywords
must be on lines with the same level of indentation to toggle correctly.

- - -

<a id="try_to_autocomplete_end"></a>
### `try_to_autocomplete_end`()

Tries to autocomplete Ruby's `end` keyword for control structures like `if`,
`while`, `for`, etc.

See also:

* [`control_structure_patterns`](#control_structure_patterns)

- - -


## Tables

- - -

<a id="_G.keys.ruby"></a>
### `_G.keys.ruby`

Container for Ruby-specific key bindings.

- - -

<a id="_G.snippets.ruby"></a>
### `_G.snippets.ruby`

Container for Ruby-specific snippets.

- - -

<a id="control_structure_patterns"></a>
### `control_structure_patterns`

Patterns for auto `end` completion for control structures.

See also:

* [`try_to_autocomplete_end`](#try_to_autocomplete_end)

- - -

