umbrello 2.39.2 Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology

- Main Page
- Related Pages
- Topics
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions | List of all members
RubyCodeGenerator Class Reference

`#include <rubycodegenerator.h>`

Inheritance diagram for RubyCodeGenerator:

## Public Member Functions
| RubyCodeGenerator ()
virtual | ~RubyCodeGenerator ()
bool | getAutoGenerateAttribAccessors ()
bool | getAutoGenerateAssocAccessors ()
virtual CodeViewerDialog * | getCodeViewerDialog (QWidget *parent, CodeDocument *doc, Settings::CodeViewerState &state)
RubyCodeGenerationPolicy * | getRubyPolicy ()
CodeDocument * | newClassifierCodeDocument (UMLClassifier *classifier)
Uml::ProgrammingLanguage::Enum | language () const
virtual QStringList | reservedKeywords () const
Public Member Functions inherited from AdvancedCodeGenerator
| AdvancedCodeGenerator ()
virtual | ~AdvancedCodeGenerator ()
Public Member Functions inherited from CodeGenerator
| CodeGenerator ()
virtual | ~CodeGenerator ()
bool | addCodeDocument (CodeDocument *add_object)
bool | removeCodeDocument (CodeDocument *remove_object)
CodeDocumentList * | getCodeDocumentList ()
QString | getUniqueID (CodeDocument *codeDoc)
virtual void | saveToXMI (QXmlStreamWriter &writer)
CodeDocument * | findCodeDocumentByID (const QString &id)
virtual void | writeCodeToFile ()
virtual void | writeCodeToFile (UMLClassifierList &list)
void | setIncludeHeadings (bool i)
bool | includeHeadings () const
void | setHeadingFileDir (const QString &)
QString | headingFileDir () const
void | setForceDoc (bool f)
bool | forceDoc () const
void | setSectionCommentPolicy (CodeGenerationPolicy::WriteSectionCommentsPolicy f)
bool | forceSections () const
virtual QString | getHeadingFile (const QString &file)
QString | findFileName (CodeDocument *codeDocument)
virtual void | loadFromXMI (QDomElement &element)
CodeDocument * | findCodeDocumentByClassifier (UMLClassifier *classifier)
virtual QStringList | defaultDatatypes () const
virtual bool | isReservedKeyword (const QString &keyword)
virtual void | createDefaultStereotypes ()

## Static Public Member Functions
static QString | getListFieldClassName ()
static QString | cppToRubyType (const QString &cppType)
static QString | cppToRubyName (const QString &cppName)
Static Public Member Functions inherited from CodeGenerator
static QString | cleanName (const QString &name)
static QString | formatDoc (const QString &text, const QString &linePrefix=QStringLiteral(" *"), int lineWidth=80)
static QString | formatFullDocBlock (const QString &text, const QString &blockHeader=QStringLiteral("/* "), const QString &blockFooter=QStringLiteral(" */"), const QString &linePrefix=QStringLiteral(" *"), int lineWidth=80)
static QString | formatSourceCode (const QString &code, const QString &indentation)
static void | findObjectsRelated (UMLClassifier *c, UMLPackageList &cList)

## Additional Inherited Members
Public Types inherited from CodeGenerator
enum | GenerationState { Generated , Failed , Skipped }
Public Slots inherited from AdvancedCodeGenerator
virtual void | checkAddUMLObject (UMLObject *obj)
virtual void | checkRemoveUMLObject (UMLObject *obj)
Public Slots inherited from CodeGenerator
virtual void | syncCodeToDocument ()
Signals inherited from CodeGenerator
void | codeGenerated (UMLClassifier *classifier, bool generated)
void | codeGenerated (UMLClassifier *classifier, CodeGenerator::GenerationState result)
void | showGeneratedFile (const QString &filename)
Protected Member Functions inherited from AdvancedCodeGenerator
virtual void | initFromParentDocument ()
void | connectSlots ()
Protected Member Functions inherited from CodeGenerator
QString | overwritableName (const QString &name, const QString &extension)
bool | openFile (QFile &file, const QString &name)
void | writeListedCodeDocsToFile (CodeDocumentList *docs)
virtual void | finalizeRun ()
Protected Attributes inherited from CodeGenerator
QHash< QString, CodeDocument * > | m_codeDocumentDictionary
bool | m_applyToAllRemaining
UMLDoc * | m_document

## Constructor & Destructor Documentation

## ◆ RubyCodeGenerator()

RubyCodeGenerator::RubyCodeGenerator | ( |  | ) |

Constructor.

## ◆ ~RubyCodeGenerator()

RubyCodeGenerator::~RubyCodeGenerator | ( |  | ) |
| virtual

Destructor.

## Member Function Documentation

## ◆ cppToRubyName()

QString RubyCodeGenerator::cppToRubyName | ( | const QString & | cppName | ) |
| static

Convert C++ names such as 'm_foobar' or pFoobar to just 'foobar' for ruby.

Parameters

  cppName | the C++ name to be converted

Returns
  the ruby name as string

## ◆ cppToRubyType()

QString RubyCodeGenerator::cppToRubyType | ( | const QString & | cppType | ) |
| static

Convert a C++ type such as 'int' or 'QWidget' to ruby types Integer and Qt::Widget.

Parameters

  cppType | the C++ type to be converted

Returns
  the ruby type as string

## ◆ getAutoGenerateAssocAccessors()

bool RubyCodeGenerator::getAutoGenerateAssocAccessors | ( |  | ) |

A utility method to get the rubyCodeGenerationPolicy()->getAutoGenerateAssocAccessors() value.

Returns
  flag

## ◆ getAutoGenerateAttribAccessors()

bool RubyCodeGenerator::getAutoGenerateAttribAccessors | ( |  | ) |

A utility method to get the rubyCodeGenerationPolicy()->getAutoGenerateAttribAccessors() value.

Returns
  flag

## ◆ getCodeViewerDialog()

CodeViewerDialog * RubyCodeGenerator::getCodeViewerDialog | ( | QWidget * | parent,
|  | CodeDocument * | doc,
|  | Settings::CodeViewerState & | state )
| virtual

Get the editing dialog for this code document.

Returns
  code viewer dialog object

Reimplemented from AdvancedCodeGenerator.

## ◆ getListFieldClassName()

QString RubyCodeGenerator::getListFieldClassName | ( |  | ) |
| static

Get the list variable class name to use. For Ruby, we have set this to "Array".

Returns
  name of list field class

## ◆ getRubyPolicy()

RubyCodeGenerationPolicy * RubyCodeGenerator::getRubyPolicy | ( |  | ) |

Utility function for getting the ruby code generation policy.

Returns
  Ruby code generation policy object

## ◆ language()

Uml::ProgrammingLanguage::Enum RubyCodeGenerator::language | ( |  | ) | const
| virtual

Return our language.

Returns
  language identifier

Implements CodeGenerator.

## ◆ newClassifierCodeDocument()

CodeDocument * RubyCodeGenerator::newClassifierCodeDocument | ( | UMLClassifier * | classifier | ) |
| virtual

Create a new classifier code document.

Parameters

  classifier | the UML classifier

Returns
  a new classifier code document

Implements AdvancedCodeGenerator.

## ◆ reservedKeywords()

QStringList RubyCodeGenerator::reservedKeywords | ( |  | ) | const
| virtual

Get list of reserved keywords.

Returns
  the list of reserved keywords

Reimplemented from CodeGenerator.

The documentation for this class was generated from the following files:

- umbrello/codegenerators/ruby/rubycodegenerator.h
- umbrello/codegenerators/ruby/rubycodegenerator.cpp