Method: Slither.define

Defined in:
lib/slither.rb

.define(name, options = {}) {|definition| ... } ⇒ Object

Define a Slither’s definition to parse a file.

name - String name of the definition, this should be unique. options - Hash of options to pass to the definition.

Ex: by_bytes: true, to parse by bytes
Ex: align: :left, to align the columns to the left

block - Block to define the sections of the definition. See README.md for more info.

Yields:

  • (definition)


39
40
41
42
43
44
# File 'lib/slither.rb', line 39

def self.define(name, options = {}, &block) # rubocop:disable Lint/UnusedMethodArgument
  definition = Definition.new(options)
  yield(definition)
  definitions[name] = definition
  definition
end