Sha256: 4201b2c8b0c24eb4198e85b48e7baa57d6506743299fcdf8125c3ad7dc4c3946

Contents?: true

Size: 519 Bytes

Versions: 8

Compression:

Stored size: 519 Bytes

Contents

# frozen_string_literal: true

module RocketChat
  module Messages
    #
    # Room params builder for calls with room parameters
    #
    module RoomSupport
      def room_params(id, name)
        if id
          { roomId: id }
        elsif name
          { roomName: name }
        else
          {}
        end
      end

      def room_query_params(id, name)
        if id
          { _id: id }
        elsif name
          { name: name }
        else
          {}
        end.to_json
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rocketchat-0.2.6 lib/rocket_chat/messages/room_support.rb
rocketchat-0.2.5 lib/rocket_chat/messages/room_support.rb
rocketchat-0.2.4 lib/rocket_chat/messages/room_support.rb
rocketchat-0.2.3 lib/rocket_chat/messages/room_support.rb
rocketchat-0.2.2 lib/rocket_chat/messages/room_support.rb
rocketchat-0.2.1 lib/rocket_chat/messages/room_support.rb
rocketchat-0.1.23 lib/rocket_chat/messages/room_support.rb
rocketchat-0.1.22 lib/rocket_chat/messages/room_support.rb