Class: Headdesk::APKDescriber

Inherits:
Object
  • Object
show all
Defined in:
lib/headdesk/descriptionator.rb

Overview

Descriptions for APK methods

:reek:RepeatedConditional

Instance Method Summary collapse

Constructor Details

#initialize(mode) ⇒ APKDescriber

Returns a new instance of APKDescriber.



11
12
13
# File 'lib/headdesk/descriptionator.rb', line 11

def initialize(mode)
  @unless = (mode == :unless)
end

Instance Method Details

#class?(decl) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/headdesk/descriptionator.rb', line 15

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

#min_sdk(gt_eq) ⇒ Object



23
24
25
# File 'lib/headdesk/descriptionator.rb', line 23

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

#resourcesObject



27
28
29
# File 'lib/headdesk/descriptionator.rb', line 27

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

#targets_sdk(gt_eq) ⇒ Object



19
20
21
# File 'lib/headdesk/descriptionator.rb', line 19

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