Class: ActiveMcp::Resource::Base
- Inherits:
-
Object
- Object
- ActiveMcp::Resource::Base
- Defined in:
- lib/active_mcp/resource/base.rb
Class Attribute Summary collapse
-
.arguments ⇒ Object
readonly
Returns the value of attribute arguments.
-
.schema ⇒ Object
readonly
Returns the value of attribute schema.
Class Method Summary collapse
Instance Method Summary collapse
- #content ⇒ Object
- #description ⇒ Object
-
#initialize ⇒ Base
constructor
A new instance of Base.
- #resource_name ⇒ Object
- #visible?(context: {}) ⇒ Boolean
Constructor Details
#initialize ⇒ Base
Returns a new instance of Base.
21 22 |
# File 'lib/active_mcp/resource/base.rb', line 21 def initialize end |
Class Attribute Details
.arguments ⇒ Object (readonly)
Returns the value of attribute arguments.
7 8 9 |
# File 'lib/active_mcp/resource/base.rb', line 7 def arguments @arguments end |
.schema ⇒ Object (readonly)
Returns the value of attribute schema.
7 8 9 |
# File 'lib/active_mcp/resource/base.rb', line 7 def schema @schema end |
Class Method Details
.argument(name, complete:) ⇒ Object
15 16 17 18 |
# File 'lib/active_mcp/resource/base.rb', line 15 def argument(name, complete:) @arguments = {} @arguments[name] = complete end |
.description ⇒ Object
9 10 |
# File 'lib/active_mcp/resource/base.rb', line 9 def description end |
.mime_type ⇒ Object
12 13 |
# File 'lib/active_mcp/resource/base.rb', line 12 def mime_type end |
Instance Method Details
#content ⇒ Object
34 35 36 37 38 39 40 41 42 43 |
# File 'lib/active_mcp/resource/base.rb', line 34 def content case text when String text when Hash text.to_json else text.to_s end end |
#description ⇒ Object
27 28 |
# File 'lib/active_mcp/resource/base.rb', line 27 def description end |
#resource_name ⇒ Object
24 25 |
# File 'lib/active_mcp/resource/base.rb', line 24 def resource_name end |
#visible?(context: {}) ⇒ Boolean
30 31 32 |
# File 'lib/active_mcp/resource/base.rb', line 30 def visible?(context: {}) true end |