Sha256: d64371791ad4f75e71f34f2e1dec3b2ae50d2844520ff9f478c1484ec6446f00

Contents?: true

Size: 386 Bytes

Versions: 1

Compression:

Stored size: 386 Bytes

Contents

require 'socket'
require 'any_bar/version'

module AnyBar
  class Client
    HOSTNAME = 'localhost'

    attr_reader :color

    def initialize(port = nil)
      @port = port.nil? ? 1738 : port.to_i
    end

    def color=(color)
      @color = color
      any_bar = UDPSocket.new
      any_bar.connect HOSTNAME, @port
      any_bar.send @color, 0
      any_bar.close
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
any_bar-0.1.0 lib/any_bar.rb