class Skiff::Probe

Public Class Methods

new(base_path, name) click to toggle source
# File lib/skiff/probe.rb, line 3
def initialize(base_path, name)
  @full_path_name = File.join([base_path, name, "w1_slave"])
end

Public Instance Methods

fahrenheit() click to toggle source
# File lib/skiff/probe.rb, line 7
def fahrenheit
  (temperature * 1.8) + 32.0
end
raw() click to toggle source
# File lib/skiff/probe.rb, line 11
def raw
  file_contents = File.read(@full_path_name)
end
temperature() click to toggle source
# File lib/skiff/probe.rb, line 15
def temperature
  temperature_data = raw.split('t=').last
  temperature =  temperature_data.to_f / 1000
  return temperature
end