Sha256: 6b444f5751481876f4b5bb96779091a61cbcd39753e964cf0e49eff5405ef91e

Contents?: true

Size: 384 Bytes

Versions: 1

Compression:

Stored size: 384 Bytes

Contents

module Esbit
  class Room
    attr_reader :id, :name, :connection

    def initialize(room_json, connection)
      @id = room_json["id"]
      @name = room_json["name"]
      @connection = connection
    end

    def say(message)
      json_message = {message: {type: 'TextMessage', body: message}}
      @connection.post "/room/#{@id}/speak", json_message(message)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
esbit-0.0.3 lib/esbit/room.rb