Class: CodexSDK::Items::FileChange

Inherits:
Data
  • Object
show all
Defined in:
lib/codex_sdk/items.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#changesObject (readonly)

Returns the value of attribute changes

Returns:

  • (Object)

    the current value of changes



44
45
46
# File 'lib/codex_sdk/items.rb', line 44

def changes
  @changes
end

#idObject (readonly)

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



44
45
46
# File 'lib/codex_sdk/items.rb', line 44

def id
  @id
end

#statusObject (readonly)

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



44
45
46
# File 'lib/codex_sdk/items.rb', line 44

def status
  @status
end

Class Method Details

.from_json(data) ⇒ Object



45
46
47
48
49
50
# File 'lib/codex_sdk/items.rb', line 45

def self.from_json(data)
  changes = (data["changes"] || []).map do |c|
    { path: c["path"], kind: c["kind"] }
  end
  new(id: data["id"], changes: changes, status: data["status"].to_s)
end