Sha256: 80c02ebbc6bcee3a9b7f76a1562c34e87904edc027669b1110f4f5a7ca2c5773

Contents?: true

Size: 857 Bytes

Versions: 15

Compression:

Stored size: 857 Bytes

Contents

# frozen_string_literal: true

require 'headdesk/descriptionator/resources'

module Headdesk
  #
  # Descriptions for APK methods
  #
  # :reek:RepeatedConditional
  class APKDescriber
    def initialize(mode)
      @unless = (mode == :unless)
    end

    def class?(decl)
      "APK #{@unless ? 'contains' : 'does not contain'} class #{decl.tr('/', '.')}"
    end

    def targets_sdk(gt_eq)
      "APK targets API #{@unless ? '>=' : '<'} #{gt_eq}"
    end

    def min_sdk(gt_eq)
      "APK requires #{@unless ? 'at least' : 'less than'} API #{gt_eq}"
    end

    def resources
      @resources ||= APKResourcesDescriber.new(@unless)
    end
  end

  #
  # Turn parameters passed skip_check and fail_check into descriptions
  #
  class Descriptionator
    attr_reader :apk

    def initialize(mode)
      @apk = APKDescriber.new(mode)
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
headdesk-0.17.0 lib/headdesk/descriptionator.rb
headdesk-0.16.2 lib/headdesk/descriptionator.rb
headdesk-0.16.1 lib/headdesk/descriptionator.rb
headdesk-0.16.0 lib/headdesk/descriptionator.rb
headdesk-0.15.1 lib/headdesk/descriptionator.rb
headdesk-0.15.0 lib/headdesk/descriptionator.rb
headdesk-0.14.0 lib/headdesk/descriptionator.rb
headdesk-0.13.0 lib/headdesk/descriptionator.rb
headdesk-0.12.0 lib/headdesk/descriptionator.rb
headdesk-0.11.3 lib/headdesk/descriptionator.rb
headdesk-0.11.2 lib/headdesk/descriptionator.rb
headdesk-0.11.1 lib/headdesk/descriptionator.rb
headdesk-0.11.0 lib/headdesk/descriptionator.rb
headdesk-0.10.0 lib/headdesk/descriptionator.rb
headdesk-0.9.0 lib/headdesk/descriptionator.rb