Class: Copilot::CanvasHostContext
- Inherits:
-
Struct
- Object
- Struct
- Copilot::CanvasHostContext
- Defined in:
- lib/copilot/types.rb
Overview
Host context passed to canvas callbacks.
Instance Attribute Summary collapse
-
#capabilities ⇒ Object
Returns the value of attribute capabilities.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#capabilities ⇒ Object
Returns the value of attribute 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_h ⇒ Object
130 131 132 |
# File 'lib/copilot/types.rb', line 130 def to_h { capabilities: (capabilities || CanvasHostCapabilities.new(canvases: false)).to_h } end |