Class: Castkit::CLI::List

Inherits:
Thor
  • Object
show all
Defined in:
lib/castkit/cli/list.rb

Overview

CLI commands for listing internal Castkit registry components.

Supports listing:

  • Registered types (‘castkit list types`)

  • Available validators (‘castkit list validators`)

Examples:

Show all available types

$ castkit list types

Show all defined validators

$ castkit list validators

Instance Method Summary collapse

Instance Method Details

#contractsvoid

This method returns an undefined value.

Lists all Castkit contract classes defined in the file system or registered under the Castkit namespace.



42
43
44
# File 'lib/castkit/cli/list.rb', line 42

def contracts
  list_files("contracts")
end

#dataobjectsvoid

This method returns an undefined value.

Lists all Castkit DataObjects classes defined in the file system or registered under the Castkit namespace.



50
51
52
# File 'lib/castkit/cli/list.rb', line 50

def dataobjects
  list_files("data_objects")
end

#serializersvoid

This method returns an undefined value.

Lists all Castkit serializers classes defined in the file system or registered under the Castkit namespace.



58
59
60
# File 'lib/castkit/cli/list.rb', line 58

def serializers
  list_files("serializers")
end

#typesvoid

This method returns an undefined value.

Lists registered Castkit types, grouped into native and custom-defined.



30
31
32
33
34
35
36
# File 'lib/castkit/cli/list.rb', line 30

def types
  all_keys = Castkit.configuration.types
  default_keys = Castkit::Configuration::DEFAULT_TYPES.keys

  native_types(all_keys, default_keys)
  custom_types(all_keys, default_keys)
end

#validatorsvoid

This method returns an undefined value.

Lists all Castkit validator classes defined in the file system or registered under the Castkit namespace.



66
67
68
# File 'lib/castkit/cli/list.rb', line 66

def validators
  list_files("validators")
end