meisyal / staruml-ruby

A Ruby extension for StarUML.
https://staruml.io/extensions
MIT License
26 stars 1 forks source link

Requiring another file #4

Closed meisyal closed 7 years ago

meisyal commented 7 years ago

When a class contains another class declaration that needs to be called (these classes are in separate files), that class must include class declaration using require keyword. require keyword pulls in Ruby code from a file outside current file. For example, there are two files, Shape (shape.rb) and Circle (circle.rb) classes in the same directory. Circle class contains Shape class declaration. So, Circle class needs to include Shape class using require ./shape.rb.

There are three possible cases a file requires another file:

  1. Those files in the same directory.
  2. A file requires another file that in a subdirectory of current directory.
  3. A file requires another file that in up one level of current directory.

Currently, this feature only supports for association class in the same directory. The extension uses require_relative instead of require keyword. The remaining cases will be handled in the future release.

*Note that this feature also affects generalization (inheritance), interface, and other relationship between classes.

meisyal commented 7 years ago

This feature has been included in release 0.1.6.