Class: RubyLLM::MCP::Extensions::Apps::ResourceMetadata

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_llm/mcp/extensions/apps/resource_metadata.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw) ⇒ ResourceMetadata

Returns a new instance of ResourceMetadata.



10
11
12
13
14
15
16
17
18
19
# File 'lib/ruby_llm/mcp/extensions/apps/resource_metadata.rb', line 10

def initialize(raw)
  @raw = raw.is_a?(Hash) ? raw : {}

  ui_meta = @raw[Constants::UI_KEY]
  @csp = ui_meta&.dig(Constants::CSP_KEY)
  @permissions = ui_meta&.dig(Constants::PERMISSIONS_KEY)
  @domain = ui_meta&.dig(Constants::DOMAIN_KEY)
  @prefers_border = ui_meta&.dig(Constants::PREFERS_BORDER_KEY)
  @prefers_border = ui_meta&.dig(Constants::PREFERS_BORDER_ALT_KEY) if @prefers_border.nil?
end

Instance Attribute Details

#cspObject (readonly)

Returns the value of attribute csp.



8
9
10
# File 'lib/ruby_llm/mcp/extensions/apps/resource_metadata.rb', line 8

def csp
  @csp
end

#domainObject (readonly)

Returns the value of attribute domain.



8
9
10
# File 'lib/ruby_llm/mcp/extensions/apps/resource_metadata.rb', line 8

def domain
  @domain
end

#permissionsObject (readonly)

Returns the value of attribute permissions.



8
9
10
# File 'lib/ruby_llm/mcp/extensions/apps/resource_metadata.rb', line 8

def permissions
  @permissions
end

#prefers_borderObject (readonly)

Returns the value of attribute prefers_border.



8
9
10
# File 'lib/ruby_llm/mcp/extensions/apps/resource_metadata.rb', line 8

def prefers_border
  @prefers_border
end

#rawObject (readonly)

Returns the value of attribute raw.



8
9
10
# File 'lib/ruby_llm/mcp/extensions/apps/resource_metadata.rb', line 8

def raw
  @raw
end