class ACappella::Client

Public Class Methods

new(options = {}) click to toggle source
# File lib/acappella/client.rb, line 6
def initialize(options = {})
  host = options[:host] || 'localhost'
  port = options[:port] || '8989'

  uri = URI.parse("druby://#{host}:#{port}").to_s

  puts "Connect to #{uri}"
  puts 'Run `acappella-client --help` for more startup options'

  @songwriter = DRb::DRbObject.new_with_uri(uri)
end

Public Instance Methods

send(lyrics) click to toggle source
# File lib/acappella/client.rb, line 18
def send(lyrics)
  @songwriter.write(lyrics)
rescue => e
  puts e.message
end