Sha256: f03959fb39854ab8747756893542f77333040770ec8ff128a5e301d623db99c0

Contents?: true

Size: 707 Bytes

Versions: 1

Compression:

Stored size: 707 Bytes

Contents

# frozen_string_literal: true

require_relative '../helper/json_converter'
class AppSizeModel < JSONConverter
  attr_reader :compressed, :uncompressed

  PARSING_KEYS = {
    compressed: 'compressed',
    uncompressed: 'uncompressed'
  }.freeze

  def initialize(compressed: SizeModel.placeholder, uncompressed: SizeModel.placeholder)
    super()
    @compressed = compressed
    @uncompressed = uncompressed
  end
end

class SizeModel < JSONConverter
  attr_reader :raw_value, :value, :unit

  def initialize(raw_value, value, unit)
    super()
    @raw_value = raw_value
    @value = value
    @unit = unit
  end

  def self.placeholder
    SizeModel.new('Unknown', 0, MemorySize::UNIT[:bytes])
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
danger-app_size_report-0.0.3 lib/converter/models/app_size_model.rb