Class: Apkstats::Entity::ApkInfoDiff
- Inherits:
-
Object
- Object
- Apkstats::Entity::ApkInfoDiff
- Defined in:
- lib/apkstats/entity/apk_info_diff.rb
Constant Summary collapse
- KEYS =
Apkstats::Entity::ApkInfo::KEYS
Instance Method Summary collapse
- #dex_count ⇒ Object
- #download_size ⇒ Object
- #file_size ⇒ Object
-
#initialize(base, other) ⇒ ApkInfoDiff
constructor
A new instance of ApkInfoDiff.
- #method_reference_count ⇒ Object
- #min_sdk ⇒ Object
- #non_required_features ⇒ Object
- #permissions ⇒ Object
- #required_features ⇒ Object
- #target_sdk ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(base, other) ⇒ ApkInfoDiff
Returns a new instance of ApkInfoDiff.
12 13 14 15 |
# File 'lib/apkstats/entity/apk_info_diff.rb', line 12 def initialize(base, other) @base = base @other = other end |
Instance Method Details
#dex_count ⇒ Object
72 73 74 75 |
# File 'lib/apkstats/entity/apk_info_diff.rb', line 72 def dex_count # Integer @base[__method__].to_i - @other[__method__].to_i end |
#download_size ⇒ Object
28 29 30 31 |
# File 'lib/apkstats/entity/apk_info_diff.rb', line 28 def download_size # Integer @base[__method__].to_i - @other[__method__].to_i end |
#file_size ⇒ Object
23 24 25 26 |
# File 'lib/apkstats/entity/apk_info_diff.rb', line 23 def file_size # Integer @base[__method__].to_i - @other[__method__].to_i end |
#method_reference_count ⇒ Object
67 68 69 70 |
# File 'lib/apkstats/entity/apk_info_diff.rb', line 67 def method_reference_count # Integer @base[__method__].to_i - @other[__method__].to_i end |
#min_sdk ⇒ Object
57 58 59 60 |
# File 'lib/apkstats/entity/apk_info_diff.rb', line 57 def min_sdk # String [@base[__method__], @other[__method__]].uniq end |
#non_required_features ⇒ Object
41 42 43 44 45 46 47 |
# File 'lib/apkstats/entity/apk_info_diff.rb', line 41 def non_required_features # Features { new: (@base[__method__] - @other[__method__]).to_a, removed: (@other[__method__] - @base[__method__]).to_a, } end |
#permissions ⇒ Object
49 50 51 52 53 54 55 |
# File 'lib/apkstats/entity/apk_info_diff.rb', line 49 def # Permissions { new: (@base[__method__] - @other[__method__]).to_a, removed: (@other[__method__] - @base[__method__]).to_a, } end |
#required_features ⇒ Object
33 34 35 36 37 38 39 |
# File 'lib/apkstats/entity/apk_info_diff.rb', line 33 def required_features # Features { new: (@base[__method__] - @other[__method__]).to_a, removed: (@other[__method__] - @base[__method__]).to_a, } end |
#target_sdk ⇒ Object
62 63 64 65 |
# File 'lib/apkstats/entity/apk_info_diff.rb', line 62 def target_sdk # String [@base[__method__], @other[__method__]].uniq end |
#to_h ⇒ Object
17 18 19 20 21 |
# File 'lib/apkstats/entity/apk_info_diff.rb', line 17 def to_h KEYS.each_with_object({}) do |key, acc| acc[key] = self.send(key) end.compact end |