class Natives::HostDetection::Platform

Public Class Methods

new() click to toggle source
# File lib/natives/host_detection/platform.rb, line 7
def initialize
  @ohai = build_ohai
end

Public Instance Methods

name() click to toggle source
# File lib/natives/host_detection/platform.rb, line 11
def name
  ohai_hash[:platform]
end
ohai_hash() click to toggle source
# File lib/natives/host_detection/platform.rb, line 19
def ohai_hash
  @ohai
end
version() click to toggle source
# File lib/natives/host_detection/platform.rb, line 15
def version
  ohai_hash[:platform_version]
end

Protected Instance Methods

build_ohai() click to toggle source
# File lib/natives/host_detection/platform.rb, line 25
def build_ohai
  ohai = Ohai::System.new
  ohai.require_plugin 'os'
  ohai.require_plugin 'platform'
  ohai
end