Sha256: 53c2741f92b3d6a8126dc1da67a5f36de965d51b44a3e85ca4a71cc260441ed3

Contents?: true

Size: 483 Bytes

Versions: 25

Compression:

Stored size: 483 Bytes

Contents

# frozen_string_literal: true

module Headdesk
  class Apk
    #
    # A Smali bytecode field
    #
    class Field
      attr_reader :code, :value

      def initialize(matchdata)
        @code = matchdata[0]
        @value = matchdata[1]

        @value.extend(ExtraMethods)
      end
    end

    #
    # Extra methods for 'value'
    #
    module ExtraMethods
      def to_version
        /^(\d+\.)?(\d+\.)?(\*|\d+)$/.match(self).captures.map(&:to_i)
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
headdesk-0.17.0 lib/headdesk/apk/field.rb
headdesk-0.16.2 lib/headdesk/apk/field.rb
headdesk-0.16.1 lib/headdesk/apk/field.rb
headdesk-0.16.0 lib/headdesk/apk/field.rb
headdesk-0.15.1 lib/headdesk/apk/field.rb
headdesk-0.15.0 lib/headdesk/apk/field.rb
headdesk-0.14.0 lib/headdesk/apk/field.rb
headdesk-0.13.0 lib/headdesk/apk/field.rb
headdesk-0.12.0 lib/headdesk/apk/field.rb
headdesk-0.11.3 lib/headdesk/apk/field.rb
headdesk-0.11.2 lib/headdesk/apk/field.rb
headdesk-0.11.1 lib/headdesk/apk/field.rb
headdesk-0.11.0 lib/headdesk/apk/field.rb
headdesk-0.10.0 lib/headdesk/apk/field.rb
headdesk-0.9.0 lib/headdesk/apk/field.rb
headdesk-0.8.0 lib/headdesk/apk/field.rb
headdesk-0.7.0 lib/headdesk/apk/field.rb
headdesk-0.6.0 lib/headdesk/apk/field.rb
headdesk-0.5.2 lib/headdesk/apk/field.rb
headdesk-0.5.1 lib/headdesk/apk/field.rb