Class: Ask::MCP::Prompt
- Inherits:
-
Object
- Object
- Ask::MCP::Prompt
- Defined in:
- lib/ask/mcp/prompt.rb
Instance Attribute Summary collapse
-
#arguments ⇒ Object
readonly
Returns the value of attribute arguments.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#icons ⇒ Object
readonly
Returns the value of attribute icons.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name:, description: nil, arguments: [], title: nil, icons: []) ⇒ Prompt
constructor
A new instance of Prompt.
- #to_h ⇒ Object
Constructor Details
#initialize(name:, description: nil, arguments: [], title: nil, icons: []) ⇒ Prompt
Returns a new instance of Prompt.
8 9 10 11 12 13 14 |
# File 'lib/ask/mcp/prompt.rb', line 8 def initialize(name:, description: nil, arguments: [], title: nil, icons: []) @name = name @description = description @arguments = arguments @title = title @icons = icons end |
Instance Attribute Details
#arguments ⇒ Object (readonly)
Returns the value of attribute arguments.
6 7 8 |
# File 'lib/ask/mcp/prompt.rb', line 6 def arguments @arguments end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
6 7 8 |
# File 'lib/ask/mcp/prompt.rb', line 6 def description @description end |
#icons ⇒ Object (readonly)
Returns the value of attribute icons.
6 7 8 |
# File 'lib/ask/mcp/prompt.rb', line 6 def icons @icons end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/ask/mcp/prompt.rb', line 6 def name @name end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
6 7 8 |
# File 'lib/ask/mcp/prompt.rb', line 6 def title @title end |
Class Method Details
.from_h(hash) ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'lib/ask/mcp/prompt.rb', line 25 def self.from_h(hash) new( name: hash[:name] || hash["name"], description: hash[:description] || hash["description"], arguments: hash[:arguments] || hash["arguments"] || [], title: hash[:title] || hash["title"], icons: hash[:icons] || hash["icons"] || [] ) end |
Instance Method Details
#to_h ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/ask/mcp/prompt.rb', line 16 def to_h h = { name: @name } h[:title] = @title if @title h[:description] = @description if @description h[:arguments] = @arguments if @arguments.any? h[:icons] = @icons if @icons.any? h end |