Class: Plasma::ComponentGenerator
- Inherits:
-
Object
- Object
- Plasma::ComponentGenerator
- Defined in:
- lib/plasma/component_generator.rb
Overview
Handles generating individual MCP components (tools, prompts, resources, variables)
Instance Attribute Summary collapse
-
#component_type ⇒ Object
readonly
Returns the value of attribute component_type.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(component_type, name, params = {}) ⇒ ComponentGenerator
constructor
A new instance of ComponentGenerator.
Constructor Details
#initialize(component_type, name, params = {}) ⇒ ComponentGenerator
Returns a new instance of ComponentGenerator.
13 14 15 16 17 18 19 |
# File 'lib/plasma/component_generator.rb', line 13 def initialize(component_type, name, params = {}) @component_type = component_type @name = name @params = params @template_dir = File.("templates", __dir__) puts "Template directory: #{@template_dir}" end |
Instance Attribute Details
#component_type ⇒ Object (readonly)
Returns the value of attribute component_type.
11 12 13 |
# File 'lib/plasma/component_generator.rb', line 11 def component_type @component_type end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
11 12 13 |
# File 'lib/plasma/component_generator.rb', line 11 def name @name end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
11 12 13 |
# File 'lib/plasma/component_generator.rb', line 11 def params @params end |
Instance Method Details
#generate ⇒ Object
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/plasma/component_generator.rb', line 21 def generate # Check if we're in a PLASMA project directory unless plasma_project? puts "Error: Not a PLASMA project directory. Please run this command from the root of a PLASMA project." return false end create_component_file true end |