class Dashdate::Notifier

Public Class Methods

build() click to toggle source
# File lib/notifier.rb, line 8
def self.build
  new(Dashdate::Writer.new)
end
new(writer) click to toggle source
# File lib/notifier.rb, line 5
def initialize writer
  @writer = writer
end

Public Instance Methods

received_http_response_code(code) click to toggle source
# File lib/notifier.rb, line 11
def received_http_response_code code
  case code
    when 204
      @writer.write('Successfully updated dashboard!') 
    when 401 
      @writer.write('Error: Invalid Authentication Token.  Check your config.ru file.')
    else
      @writer.write("Unknown error. Received HTTP Response code: #{code}")
  end
end