Class: Copilot::CanvasHostContext

Inherits:
Struct
  • Object
show all
Defined in:
lib/copilot/types.rb

Overview

Host context passed to canvas callbacks.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#capabilitiesObject

Returns the value of attribute capabilities

Returns:

  • (Object)

    the current value of capabilities



124
125
126
# File 'lib/copilot/types.rb', line 124

def capabilities
  @capabilities
end

Class Method Details

.from_hash(h) ⇒ Object



125
126
127
128
# File 'lib/copilot/types.rb', line 125

def self.from_hash(h)
  h ||= {}
  new(capabilities: CanvasHostCapabilities.from_hash(h["capabilities"]))
end

Instance Method Details

#to_hObject



130
131
132
# File 'lib/copilot/types.rb', line 130

def to_h
  { capabilities: (capabilities || CanvasHostCapabilities.new(canvases: false)).to_h }
end