Method: OpenC3::ToolModel#initialize
- Defined in:
- lib/openc3/models/tool_model.rb
#initialize(name:, folder_name: nil, icon: 'astro:warning', url: nil, inline_url: nil, window: 'INLINE', category: nil, shown: true, position: nil, updated_at: nil, plugin: nil, needs_dependencies: false, disable_erb: nil, import_map_items: nil, scope:) ⇒ ToolModel
Returns a new instance of ToolModel.
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 |
# File 'lib/openc3/models/tool_model.rb', line 127 def initialize( name:, folder_name: nil, icon: 'astro:warning', url: nil, inline_url: nil, window: 'INLINE', category: nil, shown: true, position: nil, updated_at: nil, plugin: nil, needs_dependencies: false, disable_erb: nil, import_map_items: nil, scope: ) super("#{scope}__#{PRIMARY_KEY}", name: name, plugin: plugin, updated_at: updated_at, scope: scope) @folder_name = folder_name @icon = icon @url = url @inline_url = inline_url @window = window.to_s.upcase @category = category @shown = shown @position = position if @shown and @window == 'INLINE' @inline_url = 'main.js' unless @inline_url @url = "/tools/#{folder_name}" unless @url end @needs_dependencies = needs_dependencies @disable_erb = disable_erb @import_map_items = import_map_items end |