Moving from org's literate programming

Using

  (defvar my-ruby-outline-regexp "### \\| *def\\>\\| *module\\>\\| *class\\>")

  (defun my-ruby-outline-level ()
    "compute the level of a outline for ruby"
    (save-match-data
     (cond
       ((looking-at "###") 1)
       ((looking-at "\\( *\\)")
        (+ 2 (length (match-string 1)))))))

  (defun define-ruby-outline ()
    (make-local-variable 'outline-regexp)
    (setq outline-regexp my-ruby-outline-regexp)
    (make-local-variable 'outline-level)
    (setq outline-level #'my-ruby-outline-level)
    (outline-minor-mode))

  (add-hook 'ruby-mode-hook 'define-ruby-outline)

Make navigation in ruby as easy than in org-mode