Class: CommandTower::Configuration::Registry::AdminWorkspace::ToolDefinition
- Inherits:
-
Object
- Object
- CommandTower::Configuration::Registry::AdminWorkspace::ToolDefinition
- Includes:
- ClassComposer::Generator
- Defined in:
- lib/command_tower/configuration/registry/admin_workspace/tool_definition.rb
Constant Summary collapse
- ROUTE =
%r{\A/admin(/[a-z][a-z0-9_-]*)+\z}- DESCRIPTION_MAX_LENGTH =
160
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#owner ⇒ Object
Returns the value of attribute owner.
Instance Method Summary collapse
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
66 67 68 |
# File 'lib/command_tower/configuration/registry/admin_workspace/tool_definition.rb', line 66 def id @id end |
#owner ⇒ Object
Returns the value of attribute owner.
66 67 68 |
# File 'lib/command_tower/configuration/registry/admin_workspace/tool_definition.rb', line 66 def owner @owner end |
Instance Method Details
#scope_required? ⇒ Boolean
68 69 70 |
# File 'lib/command_tower/configuration/registry/admin_workspace/tool_definition.rb', line 68 def scope_required? scope_required == true end |
#validate_definition!(name:) ⇒ Object
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/command_tower/configuration/registry/admin_workspace/tool_definition.rb', line 72 def validate_definition!(name:) self.id = name.to_s self.owner = owner&.to_sym || :host self.label = require_present_string!(label, field: "label", name:) self.description = normalize_description!(name:) self.route = require_route!(name:) self.group = require_segment!(group, field: "group", name:) self.required_entity = require_segment!(required_entity, field: "required_entity", name:) self.icon = normalize_icon!(name:) normalize_scope!(name:) unless sort_order.is_a?(Integer) raise CommandTower::AdminWorkspace::InvalidToolDefinitionError, "admin workspace tool #{name} has invalid sort_order #{sort_order.inspect}" end end |