== Class Documentation === Simple Example with a Barren Class Given a file +lib/example.rb+ containing a minimally documented and essentially barren class: # This class is documented. class ExampleClass end Running the script through shomen command line interface, regardless of which underlying parser is used, should produce a data structure conforming to the Shomen standard data format having the following characteristics. The data structure should have three entries. @shomen.keys.assert.include?('(metadata)') @shomen.keys.assert.include?('ExampleClass') @shomen.keys.assert.include?('/lib/example.rb') The `ExampleClass` entry should have a "bang" type of `class`. @shomen['ExampleClass']['!'] #=> 'class' It should have a name of `ExampleClass`. @shomen['ExampleClass']['name'] #=> 'ExampleClass' While the namespace should be an empty string because the class is defined at the toplevel. @shomen['ExampleClass']['namespace'] #=> '' The full `path` field will be the same as the name for the same reason. @shomen['ExampleClass']['path'] #=> 'ExampleClass' The `superclass` will be Object. @shomen['ExampleClass']['superclass'] #=> 'Object' The `comment` field will as given in the script. @shomen['ExampleClass']['comment'] #=> "This class is documented." And the `files` field should list only `/lib/example.rb`. @shomen['ExampleClass']['files'] #=> ['/lib/example.rb'] Notice that the leading root slash `/` is part of the file name. This refers to the root of the project, as opposed to the root of one's file system, and makes it easier to lookup files in the index, the the root slash is used to distinguish file names from other entries. Since out example class is barren the remaining fields will either be missing (i.e. `nil`) or empty collections. @shomen['ExampleClass']['constants'].to_a #=> [] @shomen['ExampleClass']['modules'].to_a #=> [] @shomen['ExampleClass']['classes'].to_a #=> [] @shomen['ExampleClass']['methods'].to_a #=> []