class Dashdate::Publisher

Public Class Methods

build() click to toggle source
# File lib/publisher.rb, line 9
def self.build
  new(Dashdate::Notifier.build)
end
new(notifier) click to toggle source
# File lib/publisher.rb, line 6
def initialize notifier
  @notifier = notifier
end

Public Instance Methods

update(widget, values, auth) click to toggle source
# File lib/publisher.rb, line 12
def update(widget, values, auth)
  url = "http://localhost:3030/widgets/#{widget.to_s}"
  values[:auth_token] = auth
  result = HTTParty.post(url, :body => values.to_json)
  @notifier.received_http_response_code(result.code)
end