\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{Ruby Gray} \pdfinfo{ /Title (ruby.pdf) /Creator (Cheatography) /Author (Ruby Gray) /Subject (Ruby Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{CC342D} \definecolor{LightBackground}{HTML}{FBF2F1} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{Ruby Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{Ruby Gray} via \textcolor{DarkBackground}{\uline{cheatography.com/68488/cs/17257/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}Ruby Gray \\ \uline{cheatography.com/ruby-gray} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Not Yet Published.\\ Updated 10th October, 2018.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{4} \begin{tabularx}{3.833cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{3.833cm}}{\bf\textcolor{white}{General Remarks about the Language}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{IRB is an interactive Ruby Shell good for starting out. (\$ irb)} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{Ruby does not need to be compiled (most of the time) since it is interpreted.} \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{Everything in Ruby is an object.} \tn % Row Count 5 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{Ruby variables don't have types - only objects do.} \tn % Row Count 6 (+ 1) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{Ruby wants you to omit ()'s and ;'s} \tn % Row Count 7 (+ 1) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{Ruby will make you happy so enjoy.} \tn % Row Count 8 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{3.833cm}}{\bf\textcolor{white}{Control Structure}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{if {[}conditional{]} ... \newline else ... end \newline -{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}- \newline {[}conditional{]} ? true block ... : false block ... \newline -{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}- \newline if {[}conditional{]} ... \newline elsif {[}conditional{]} ... \newline else ... end \newline -{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}- \newline while {[}conditional{]} ... end \newline -{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}- \newline until {[}conditional{]} ... end \newline -{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}- \newline case someVar \newline when {[}condition{]} ... \newline when {[}condition{]} ... \newline (as many whens as needed) \newline else ... end \newline -{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}- \newline someVar.each do |x| ... end \newline someVar.each \{|x| ... \} \newline -{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}- \newline for each x in someVar do ... end} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{x{1.61351 cm} x{1.81949 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{3.833cm}}{\bf\textcolor{white}{Variable Classifications}} \tn % Row 0 \SetRowColor{LightBackground} variable\_name & Local Variable \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} VARIABLE & Constant Variable \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} @variable\_name & Instance Variable \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} @@variable\_name & Class Variable \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} = & Assignment \tn % Row Count 5 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{3.833cm}}{Everything is an object so variables do not have explicit data types} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{x{1.09856 cm} x{2.33444 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{3.833cm}}{\bf\textcolor{white}{Strings}} \tn % Row 0 \SetRowColor{LightBackground} .length & Length of the String \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \seqsplit{.count(param)} & How many times the param appears in the String \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} .insert(pos, param) & Inserts the param in the position of the String \tn % Row Count 5 (+ 2) % Row 3 \SetRowColor{white} .upcase & Converts all characters to uppercase \tn % Row Count 7 (+ 2) % Row 4 \SetRowColor{LightBackground} .downcase & Converts all characters to lowercase \tn % Row Count 9 (+ 2) % Row 5 \SetRowColor{white} .swapcase & Converts all uppercase characters lowercase \& lowercase to uppercase \tn % Row Count 12 (+ 3) % Row 6 \SetRowColor{LightBackground} .reverse & Reverses the order of the characters \tn % Row Count 14 (+ 2) % Row 7 \SetRowColor{white} .split & Breakes up a String on whitespace and stores all those strings in an array \tn % Row Count 17 (+ 3) % Row 8 \SetRowColor{LightBackground} .chop & Removes the last character \tn % Row Count 18 (+ 1) % Row 9 \SetRowColor{white} .strip & Removes all whitespace, tabs, new lines \& carriage returns \tn % Row Count 21 (+ 3) % Row 10 \SetRowColor{LightBackground} .chomp & Removes the last character if it's a new line or carriage return \tn % Row Count 24 (+ 3) % Row 11 \SetRowColor{white} {[}start, end{]} & Returns a substring \tn % Row Count 25 (+ 1) % Row 12 \SetRowColor{LightBackground} .to\_i & Converts to integer \tn % Row Count 26 (+ 1) % Row 13 \SetRowColor{white} + & Concatenates strings \tn % Row Count 27 (+ 1) % Row 14 \SetRowColor{LightBackground} \seqsplit{.index(position)} & Returns the character in the specified position \tn % Row Count 29 (+ 2) % Row 15 \SetRowColor{white} .clear & Removes all content \tn % Row Count 30 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{3.833cm}}{\bf\textcolor{white}{Function Structure}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{def methodName ... end \newline \newline def methodName (param1, param2) ... end} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{No Return Statements. \newline No need for ()'s with no parameters.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{p{0.6866 cm} x{2.7464 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{3.833cm}}{\bf\textcolor{white}{Operators}} \tn % Row 0 \SetRowColor{LightBackground} \seqsplit{Arithmetic} & Operators \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} + & Addition \tn % Row Count 3 (+ 1) % Row 2 \SetRowColor{LightBackground} - & Subtraction \tn % Row Count 4 (+ 1) % Row 3 \SetRowColor{white} * & Multiplication \tn % Row Count 5 (+ 1) % Row 4 \SetRowColor{LightBackground} / & Division \tn % Row Count 6 (+ 1) % Row 5 \SetRowColor{white} \% & Modulus \tn % Row Count 7 (+ 1) % Row 6 \SetRowColor{LightBackground} ** & Exponent \tn % Row Count 8 (+ 1) % Row 7 \SetRowColor{white} Compare & Operators \tn % Row Count 9 (+ 1) % Row 8 \SetRowColor{LightBackground} == & Values Equal? \tn % Row Count 10 (+ 1) % Row 9 \SetRowColor{white} != & Values Not Equal? \tn % Row Count 11 (+ 1) % Row 10 \SetRowColor{LightBackground} \textgreater{} & Left op greater than Right op? \tn % Row Count 12 (+ 1) % Row 11 \SetRowColor{white} \textless{} & Left op Less than Right op? \tn % Row Count 13 (+ 1) % Row 12 \SetRowColor{LightBackground} \textgreater{}= & Left op greater than or equal to Right op? \tn % Row Count 15 (+ 2) % Row 13 \SetRowColor{white} \textless{}= & Left op less than or equal to Right op? \tn % Row Count 17 (+ 2) % Row 14 \SetRowColor{LightBackground} \textless{}=\textgreater{} & Spaceship: returns 0 if ops are equal, 1 if Left op is greater than Right op and -1 if Left op is less than Right op \tn % Row Count 21 (+ 4) % Row 15 \SetRowColor{white} === & A case comparative for when control structure \tn % Row Count 23 (+ 2) % Row 16 \SetRowColor{LightBackground} .eql? & Values Equal for both type and value? \tn % Row Count 25 (+ 2) % Row 17 \SetRowColor{white} .equal? & Values are the same object? \tn % Row Count 26 (+ 1) % Row 18 \SetRowColor{LightBackground} Logical & Operators \tn % Row Count 27 (+ 1) % Row 19 \SetRowColor{white} and, \&\& & AND \tn % Row Count 28 (+ 1) % Row 20 \SetRowColor{LightBackground} or, || & OR \tn % Row Count 29 (+ 1) % Row 21 \SetRowColor{white} not, ! & NOT \tn % Row Count 30 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{x{1.54485 cm} x{1.88815 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{3.833cm}}{\bf\textcolor{white}{Arrays}} \tn % Row 0 \SetRowColor{LightBackground} array = \seqsplit{Array.new(lengthParam)} & Creates array where each element is NIL \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} array = {[}element1, element2, ...{]} & Creates array with the specified elements \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} array{[}index{]} & Returns the element value at index \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} array.length & Returns the size of the array \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} array.push param \textless{}\textless{} & Adds the params as separate elements to the end of the array \tn % Row Count 11 (+ 3) % Row 5 \SetRowColor{white} array.pop & Removes the element from the end \tn % Row Count 13 (+ 2) % Row 6 \SetRowColor{LightBackground} array.unshift param & Adds the params as separate elements to the front \tn % Row Count 16 (+ 3) % Row 7 \SetRowColor{white} array.shift & Removes the element from the front \tn % Row Count 18 (+ 2) % Row 8 \SetRowColor{LightBackground} array.reverse & Reverses the order of elements \tn % Row Count 20 (+ 2) % Row 9 \SetRowColor{white} array.shuffle & Randomly shuffles up order of elements \tn % Row Count 22 (+ 2) % Row 10 \SetRowColor{LightBackground} array.sort & Sorts the array of elements \tn % Row Count 24 (+ 2) % Row 11 \SetRowColor{white} array.include? param & Returns true if the param exists in the array \tn % Row Count 27 (+ 3) % Row 12 \SetRowColor{LightBackground} array.uniq & Returns an array of only the unique elements \tn % Row Count 29 (+ 2) % Row 13 \SetRowColor{white} array.fill param & Sets all the array elements to the param \tn % Row Count 31 (+ 2) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{3.833cm}{x{1.54485 cm} x{1.88815 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{3.833cm}}{\bf\textcolor{white}{Arrays (cont)}} \tn % Row 14 \SetRowColor{LightBackground} array.each \{|x| ...\} & Iterates over each element in the array \tn % Row Count 2 (+ 2) % Row 15 \SetRowColor{white} array.each\_index\{|i| ...\} & iterates over each index in the array \tn % Row Count 4 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{3.833cm}}{A single array can hold elements of different object types.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{x{1.44186 cm} x{1.99114 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{3.833cm}}{\bf\textcolor{white}{Ranges}} \tn % Row 0 \SetRowColor{LightBackground} range = Range.new(start, end) & Creates a new Range from the starting point to the end point \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} range = start..end & Creates a range from start to end inclusive \tn % Row Count 5 (+ 2) % Row 2 \SetRowColor{LightBackground} range = start...end & Creates a range from start to end exclusive \tn % Row Count 7 (+ 2) % Row 3 \SetRowColor{white} range.to\_a & Converts a range to an array \tn % Row Count 9 (+ 2) % Row 4 \SetRowColor{LightBackground} range.each & Iterators through each element \tn % Row Count 11 (+ 2) % Row 5 \SetRowColor{white} \seqsplit{range.include?(param)} & Returns true if the param exists in the Range \tn % Row Count 13 (+ 2) % Row 6 \SetRowColor{LightBackground} range.last param & Returns the last element. Param can be added to provide more than just the last. \tn % Row Count 17 (+ 4) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{3.833cm}}{Above each function can be used with (start..end) or (start...end) as well} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{x{1.7165 cm} x{1.7165 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{3.833cm}}{\bf\textcolor{white}{Hashes}} \tn % Row 0 \SetRowColor{LightBackground} map = Hash.new & Creates an empty hash map \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} map = Hash.new(default) & Creates an empty hash map where if key or value cannot be found, default value is returned. \tn % Row Count 7 (+ 5) % Row 2 \SetRowColor{LightBackground} map = Hash{[}"key1" =\textgreater{} value1, "key2" =\textgreater{} value2, ...{]} & Creates a hash map with 2 key-value pairs \tn % Row Count 10 (+ 3) % Row 3 \SetRowColor{white} map = Hash{[}"key1" =\textgreater{} value1, "key2" =\textgreater{} value2, ...{]} & Creates a hash map with 2 key-value pairs \tn % Row Count 13 (+ 3) % Row 4 \SetRowColor{LightBackground} map{[}"key3"{]} = value3 & Adds a key-value pair to the map \tn % Row Count 15 (+ 2) % Row 5 \SetRowColor{white} map.has\_key? key & Returns true if the key exists as a key in the hash map \tn % Row Count 18 (+ 3) % Row 6 \SetRowColor{LightBackground} maps.has\_value? value & Returns true if the value exists as a value in the hash map \tn % Row Count 21 (+ 3) % Row 7 \SetRowColor{white} map.fetch key & Returns the value that corresponds to the key \tn % Row Count 24 (+ 3) % Row 8 \SetRowColor{LightBackground} map.delete param & Deletes the key-value pair with the key param \tn % Row Count 27 (+ 3) % Row 9 \SetRowColor{white} map.length & Returns the number of key-value pairs in the hash map \tn % Row Count 30 (+ 3) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{3.833cm}{x{1.7165 cm} x{1.7165 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{3.833cm}}{\bf\textcolor{white}{Hashes (cont)}} \tn % Row 10 \SetRowColor{LightBackground} map.keys & Returns an array of all the keys in the hash map \tn % Row Count 3 (+ 3) % Row 11 \SetRowColor{white} map.values & Returns an array of all the values in the hash map \tn % Row Count 6 (+ 3) % Row 12 \SetRowColor{LightBackground} map.sort & Sorts the keys of the hash map in alphabetical order \tn % Row Count 9 (+ 3) % Row 13 \SetRowColor{white} map.inspect & Returns the current state of the hash map \tn % Row Count 12 (+ 3) % Row 14 \SetRowColor{LightBackground} map.each \{|k, v| ... \} & Iterates over each key-value pair in the hash map \tn % Row Count 15 (+ 3) % Row 15 \SetRowColor{white} map.each\_key \{|k| ... \} & Iterates over each key in the hash map \tn % Row Count 17 (+ 2) % Row 16 \SetRowColor{LightBackground} map.each\_value \{|v| ... \} & Iterates over each value in the hash map \tn % Row Count 19 (+ 2) % Row 17 \SetRowColor{white} map.each\_value \{|v| ... \} & Iterates over each value in the hash map \tn % Row Count 21 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{3.833cm}}{\bf\textcolor{white}{Class Structure}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{3.833cm}}{class className1 \newline @instVariable \newline @@clssVariable \newline ... \newline attr\_accessor :instVariable \newline .. \newline def initialize \newline ... \newline end \newline \newline def classMethod1 param \newline ... \newline end \newline end \newline \newline class className2 \newline ... \newline end} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{x{0.85825 cm} x{2.57475 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{3.833cm}}{\bf\textcolor{white}{Class Details}} \tn % Row 0 \SetRowColor{LightBackground} \seqsplit{Initialize} & A method that is called internally when .new is called to create the object. \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} \seqsplit{attr\_reader} & Instance variable getter \tn % Row Count 5 (+ 2) % Row 2 \SetRowColor{LightBackground} \seqsplit{attr\_writer} & Instance variable setter \tn % Row Count 7 (+ 2) % Row 3 \SetRowColor{white} \seqsplit{attr\_accesor} & Instance variable getter and setter \tn % Row Count 9 (+ 2) % Row 4 \SetRowColor{LightBackground} \seqsplit{className.new} & Method called to create the specified object \tn % Row Count 11 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{3.833cm}}{No overloading methods in Ruby. \newline Multiple classes can be written in the same file.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}