# Module: Defining, Installing, and Using

**URL:** <https://www.ruby-forum.com/t/module-defining-installing-and-using/96514>\
**Category:** Ruby\
**Created:** [June 29, 2006, 5:29am UTC](https://www.ruby-forum.com/t/module-defining-installing-and-using/96514 "2006-06-29T05:29:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![xmg-eric](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/f04885/32.png) [@xmg-eric](https://www.ruby-forum.com/u/xmg-eric)\
**Post date:** [June 29, 2006, 5:29am UTC](https://www.ruby-forum.com/t/module-defining-installing-and-using/96514/1 "2006-06-29T05:29:51Z")

</div>

Current version of my cheat sheet.  
Will post at my web site shortly,  
with any feedback that comes my way.

## Module File

filename: .rb  
example: functions.rb

## Contents

module FUNCTIONS  
def some\_function(argument, …)  
…  
end  
module\_function :some\_function  
# ^^^ You specify a name (a symbol)  
end

## Flat Install

Copy to site\_ruby/  
example: /your/ruby/1.8.4/lib/ruby/site\_ruby/1.8

Usage:  
require ‘functions’  
include FUNCTIONS

## Nested Install

Copy to site\_ruby//  
example: /your/ruby/1.8.4/lib/ruby/site\_ruby/1.8/etc

Usage:  
require ‘etc/functions’  
include FUNCTIONS
