Class: Bsdkrun::AiSession

Inherits:
Data
  • Object
show all
Defined in:
lib/bsdkrun/types.rb

Overview

One agent sandbox. It is a machine, so +logs+/+stop+ work on id.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#agentObject (readonly)

Returns the value of attribute agent

Returns:

  • (Object)

    the current value of agent



186
187
188
# File 'lib/bsdkrun/types.rb', line 186

def agent
  @agent
end

#created_atObject (readonly)

Returns the value of attribute created_at

Returns:

  • (Object)

    the current value of created_at



186
187
188
# File 'lib/bsdkrun/types.rb', line 186

def created_at
  @created_at
end

#idObject (readonly)

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



186
187
188
# File 'lib/bsdkrun/types.rb', line 186

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



186
187
188
# File 'lib/bsdkrun/types.rb', line 186

def name
  @name
end

#runningObject (readonly)

Returns the value of attribute running

Returns:

  • (Object)

    the current value of running



186
187
188
# File 'lib/bsdkrun/types.rb', line 186

def running
  @running
end

#workspaceObject (readonly)

Returns the value of attribute workspace

Returns:

  • (Object)

    the current value of workspace



186
187
188
# File 'lib/bsdkrun/types.rb', line 186

def workspace
  @workspace
end

Class Method Details

.from_graphql(s) ⇒ AiSession Also known as: from_row

Parameters:

  • s (Hash)

Returns:



191
192
193
194
195
196
197
198
199
200
# File 'lib/bsdkrun/types.rb', line 191

def self.from_graphql(s)
  new(
    id: s["id"].to_s,
    name: s["name"].to_s,
    agent: s["agent"].to_s,
    running: !!s["running"],
    workspace: s["workspace"],
    created_at: (s["createdAt"] || s["created_at"]).to_i
  )
end