Class: Natives::HostDetection

Inherits:
Object
  • Object
show all
Defined in:
lib/natives/host_detection.rb,
lib/natives/host_detection/platform.rb,
lib/natives/host_detection/package_provider.rb

Defined Under Namespace

Classes: PackageProvider, Platform

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ HostDetection

Returns a new instance of HostDetection.



7
8
9
10
11
# File 'lib/natives/host_detection.rb', line 7

def initialize(opts={})
  @detect_platform = opts.fetch(:detect_platform) { Platform.new }
  @detect_package_provider = opts.fetch(:detect_package_provider) {
    PackageProvider.new(@detect_platform) }
end

Instance Method Details

#package_providerObject



21
22
23
# File 'lib/natives/host_detection.rb', line 21

def package_provider
  @detect_package_provider.name
end

#platformObject



13
14
15
# File 'lib/natives/host_detection.rb', line 13

def platform
  @detect_platform.name
end

#platform_versionObject



17
18
19
# File 'lib/natives/host_detection.rb', line 17

def platform_version
  @detect_platform.version
end