Class: Copilot::CanvasOpenContext

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

Overview

Context provided when a canvas is opened.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#canvas_idObject

Returns the value of attribute canvas_id

Returns:

  • (Object)

    the current value of canvas_id



136
137
138
# File 'lib/copilot/types.rb', line 136

def canvas_id
  @canvas_id
end

#extension_idObject

Returns the value of attribute extension_id

Returns:

  • (Object)

    the current value of extension_id



136
137
138
# File 'lib/copilot/types.rb', line 136

def extension_id
  @extension_id
end

#hostObject

Returns the value of attribute host

Returns:

  • (Object)

    the current value of host



136
137
138
# File 'lib/copilot/types.rb', line 136

def host
  @host
end

#inputObject

Returns the value of attribute input

Returns:

  • (Object)

    the current value of input



136
137
138
# File 'lib/copilot/types.rb', line 136

def input
  @input
end

#instance_idObject

Returns the value of attribute instance_id

Returns:

  • (Object)

    the current value of instance_id



136
137
138
# File 'lib/copilot/types.rb', line 136

def instance_id
  @instance_id
end

#session_idObject

Returns the value of attribute session_id

Returns:

  • (Object)

    the current value of session_id



136
137
138
# File 'lib/copilot/types.rb', line 136

def session_id
  @session_id
end

Class Method Details

.from_hash(h) ⇒ Object



140
141
142
143
144
145
146
147
148
149
# File 'lib/copilot/types.rb', line 140

def self.from_hash(h)
  new(
    session_id: h["sessionId"],
    extension_id: h["extensionId"],
    canvas_id: h["canvasId"],
    instance_id: h["instanceId"],
    input: h["input"],
    host: h["host"] && CanvasHostContext.from_hash(h["host"])
  )
end