Class: UffizziCore::Api::Cli::V1::Projects::Deployments::ActivityItemSerializer

Inherits:
BaseSerializer
  • Object
show all
Defined in:
app/serializers/uffizzi_core/api/cli/v1/projects/deployments/activity_item_serializer.rb

Instance Method Summary collapse

Instance Method Details

#commitObject



17
18
19
# File 'app/serializers/uffizzi_core/api/cli/v1/projects/deployments/activity_item_serializer.rb', line 17

def commit
  object.commit.to_s.slice(0..6)
end

#stateObject



21
22
23
# File 'app/serializers/uffizzi_core/api/cli/v1/projects/deployments/activity_item_serializer.rb', line 21

def state
  object.events.order_by_id.last&.state
end

#typeObject



9
10
11
12
13
14
15
# File 'app/serializers/uffizzi_core/api/cli/v1/projects/deployments/activity_item_serializer.rb', line 9

def type
  return :github if object.type == UffizziCore::ActivityItem::Github.name
  return :docker if object.type == UffizziCore::ActivityItem::Docker.name
  return :memory_limit if object.type == UffizziCore::ActivityItem::MemoryLimit.name

  nil
end