Sha256: fa0552d9115741db000979af4896812336ebf56ac75763c6be36189e2e0bb3ab
Contents?: true
Size: 1.55 KB
Versions: 3
Compression:
Stored size: 1.55 KB
Contents
# frozen_string_literal: true module Apkstats::Entity class ApkInfoDiff KEYS = Apkstats::Entity::ApkInfo::KEYS # ApkInfo attr_reader :base, :other private(:base, :other) def initialize(base, other) @base = base @other = other end def to_h KEYS.each_with_object({}) do |key, acc| acc[key] = self.send(key) end.compact end def file_size # Integer @base[__method__].to_i - @other[__method__].to_i end def download_size # Integer @base[__method__].to_i - @other[__method__].to_i end def required_features # Features { new: (@base[__method__] - @other[__method__]).to_a, removed: (@other[__method__] - @base[__method__]).to_a, } end def non_required_features # Features { new: (@base[__method__] - @other[__method__]).to_a, removed: (@other[__method__] - @base[__method__]).to_a, } end def permissions # Permissions { new: (@base[__method__] - @other[__method__]).to_a, removed: (@other[__method__] - @base[__method__]).to_a, } end def min_sdk # String [@base[__method__], @other[__method__]].uniq end def target_sdk # String [@base[__method__], @other[__method__]].uniq end def method_reference_count # Integer @base[__method__].to_i - @other[__method__].to_i end def dex_count # Integer @base[__method__].to_i - @other[__method__].to_i end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
danger-apkstats-0.3.1 | lib/apkstats/entity/apk_info_diff.rb |
danger-apkstats-0.3.0 | lib/apkstats/entity/apk_info_diff.rb |
danger-apkstats-0.2.0 | lib/apkstats/entity/apk_info_diff.rb |