Class: E2B::Models::BuildInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/e2b/models/build_info.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(alias_name:, name:, tags:, template_id:, build_id:, build_step_origins: []) ⇒ BuildInfo

Returns a new instance of BuildInfo.



19
20
21
22
23
24
25
26
# File 'lib/e2b/models/build_info.rb', line 19

def initialize(alias_name:, name:, tags:, template_id:, build_id:, build_step_origins: [])
  @alias_name = alias_name
  @name = name
  @tags = tags || []
  @template_id = template_id
  @build_id = build_id
  @build_step_origins = Array(build_step_origins).compact
end

Instance Attribute Details

#alias_nameObject (readonly)

Returns the value of attribute alias_name.



6
7
8
# File 'lib/e2b/models/build_info.rb', line 6

def alias_name
  @alias_name
end

#build_idObject (readonly)

Returns the value of attribute build_id.



6
7
8
# File 'lib/e2b/models/build_info.rb', line 6

def build_id
  @build_id
end

#build_step_originsObject (readonly)

Returns the value of attribute build_step_origins.



6
7
8
# File 'lib/e2b/models/build_info.rb', line 6

def build_step_origins
  @build_step_origins
end

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/e2b/models/build_info.rb', line 6

def name
  @name
end

#tagsObject (readonly)

Returns the value of attribute tags.



6
7
8
# File 'lib/e2b/models/build_info.rb', line 6

def tags
  @tags
end

#template_idObject (readonly)

Returns the value of attribute template_id.



6
7
8
# File 'lib/e2b/models/build_info.rb', line 6

def template_id
  @template_id
end

Class Method Details

.from_hash(data) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/e2b/models/build_info.rb', line 8

def self.from_hash(data)
  new(
    alias_name: data["alias"] || data[:alias],
    name: data["name"] || data[:name],
    tags: data["tags"] || data[:tags] || [],
    template_id: data["templateID"] || data["template_id"] || data[:templateID],
    build_id: data["buildID"] || data["build_id"] || data[:buildID],
    build_step_origins: data["buildStepOrigins"] || data["build_step_origins"] || data[:buildStepOrigins] || []
  )
end