Class: Ukiryu::Models::PlatformProfile
- Inherits:
-
Lutaml::Model::Serializable
- Object
- Lutaml::Model::Serializable
- Ukiryu::Models::PlatformProfile
- Defined in:
- lib/ukiryu/models/platform_profile.rb
Overview
Platform-specific profile for a tool
Instance Method Summary collapse
-
#clear_commands_index! ⇒ Object
private
Clear the commands index.
-
#command(name) ⇒ CommandDefinition?
Get a command by name using indexed O(1) lookup.
-
#command_names ⇒ Array<String>
Get all command names.
-
#compatible?(platform, shell) ⇒ Boolean
Check if profile is compatible with platform and shell.
-
#routing ⇒ Routing
Get the routing table as a Routing model.
-
#routing? ⇒ Boolean
Check if this profile has routing defined.
-
#supports_platform?(platform) ⇒ Boolean
Check if profile supports a platform.
-
#supports_shell?(shell) ⇒ Boolean
Check if profile supports a shell.
-
#universal? ⇒ Boolean
Check if universal (supports all).
Instance Method Details
#clear_commands_index! ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Clear the commands index
Call this if commands are modified after initial loading (e.g., during inheritance resolution)
121 122 123 124 |
# File 'lib/ukiryu/models/platform_profile.rb', line 121 def clear_commands_index! @commands_index = nil @commands_index_built = false end |
#command(name) ⇒ CommandDefinition?
Get a command by name using indexed O(1) lookup
90 91 92 93 94 95 |
# File 'lib/ukiryu/models/platform_profile.rb', line 90 def command(name) return nil unless commands build_commands_index unless @commands_index_built @commands_index[name.to_s] end |
#command_names ⇒ Array<String>
Get all command names
100 101 102 103 104 105 |
# File 'lib/ukiryu/models/platform_profile.rb', line 100 def command_names return [] unless commands build_commands_index unless @commands_index_built @commands_index.keys end |
#compatible?(platform, shell) ⇒ Boolean
Check if profile is compatible with platform and shell
82 83 84 |
# File 'lib/ukiryu/models/platform_profile.rb', line 82 def compatible?(platform, shell) supports_platform?(platform) && supports_shell?(shell) end |
#routing ⇒ Routing
Get the routing table as a Routing model
46 47 48 |
# File 'lib/ukiryu/models/platform_profile.rb', line 46 def routing @routing ||= Ukiryu::Models::Routing.new(@routing_data || {}) end |
#routing? ⇒ Boolean
Check if this profile has routing defined
53 54 55 |
# File 'lib/ukiryu/models/platform_profile.rb', line 53 def routing? !@routing_data.nil? && !@routing_data.empty? end |
#supports_platform?(platform) ⇒ Boolean
Check if profile supports a platform
61 62 63 64 65 |
# File 'lib/ukiryu/models/platform_profile.rb', line 61 def supports_platform?(platform) platform_list = cached_platforms_sym platform_list.nil? || platform_list.empty? || platform_list.include?(platform.to_sym) end |
#supports_shell?(shell) ⇒ Boolean
Check if profile supports a shell
71 72 73 74 75 |
# File 'lib/ukiryu/models/platform_profile.rb', line 71 def supports_shell?(shell) shell_list = cached_shells_sym shell_list.nil? || shell_list.empty? || shell_list.include?(shell.to_sym) end |
#universal? ⇒ Boolean
Check if universal (supports all)
110 111 112 113 |
# File 'lib/ukiryu/models/platform_profile.rb', line 110 def universal? (platforms.nil? || platforms.empty?) && (shells.nil? || shells.empty?) end |