Sha256: 765b42c8ffb16d4ef477cbf7d5b9f92805c374f0611f7c89b9e0b9bc59173c8b

Contents?: true

Size: 1.06 KB

Versions: 1

Compression:

Stored size: 1.06 KB

Contents

# frozen_string_literal: true

require_relative '../parser/variant_parser'
require_relative '../parser/variant_descriptor_parser'
require_relative '../parser/app_size_parser'

class ResultFactory
  def self.parse(from_text: '', parser: nil)
    result = nil
    case parser
    when :variant
      variant_parser = VariantParser.new(from_text)
      variant_parser.parse
      result = variant_parser.result
    when :supported_variant_descriptors
      variant_descriptor_parser = VariantDescriptorParser.new(from_text)
      variant_descriptor_parser.parse
      result = variant_descriptor_parser.result
    when :app_on_demand_resources_size
      app_size_parser = AppSizeParser.new(from_text)
      app_size_parser.parse
      result = app_size_parser.result
    when :app_size
      app_size_parser = AppSizeParser.new(from_text)
      app_size_parser.parse
      result = app_size_parser.result
    when :on_demand_resources_size
      app_size_parser = AppSizeParser.new(from_text)
      app_size_parser.parse
      result = app_size_parser.result
    end
    result
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
danger-app_size_report-0.0.3 lib/converter/helper/result_factory.rb