Module: Headdesk::Checks::Teak::APK::InstanceMethods

Defined in:
lib/headdesk/checks/teak.rb

Overview

Instance methods for Teak based checks

Instance Method Summary collapse

Instance Method Details

#preconditions?Boolean

Returns:

  • (Boolean)


33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/headdesk/checks/teak.rb', line 33

def preconditions?
  begin
    major, minor, revision = apk.find_class('io.teak.sdk.Teak')
                                .field('SDKVersion')
                                .value
                                .to_version
    @teak_sdk = OpenStruct.new(
      version: "#{major}.#{minor}.#{revision}",
      major: major, minor: minor, revision: revision
    )
  rescue NoMethodError => _e
    return false
  end
  true
end

#teak_sdkObject



49
50
51
# File 'lib/headdesk/checks/teak.rb', line 49

def teak_sdk
  @teak_sdk
end