class PolyNotify::Client
Public Class Methods
new()
click to toggle source
# File lib/PolyNotify.rb, line 15 def initialize @baseurl = 'https://www4.polymtl.ca' @headers = {'User-Agent' => 'PolyNotify v0.1'} @checksum_file = "#{ENV['HOME']}/.polynotify" @inputs = {} # For HTTParty self.class.base_uri @baseurl self.class.headers @headers end
Public Instance Methods
checksum()
click to toggle source
# File lib/PolyNotify.rb, line 34 def checksum @checksum end
last_checksum()
click to toggle source
# File lib/PolyNotify.rb, line 38 def last_checksum File.read(@checksum_file) end
load_config_file(file)
click to toggle source
# File lib/PolyNotify.rb, line 26 def load_config_file(file) @config = YAML.load(File.open(file)) end
load_config_hash(hash)
click to toggle source
# File lib/PolyNotify.rb, line 30 def load_config_hash(hash) @config = hash end
save_checksum()
click to toggle source
# File lib/PolyNotify.rb, line 42 def save_checksum File.open(@checksum_file, 'w') { |file| file.write(@checksum) } end