class Circed::Repositories::ChannelRepository

Included Modules

Defined in:

circed/repositories/channel_repository.cr

Instance Method Summary

Instance methods inherited from module Circed::Core::Repository(Circed::Domain::Channel)

add(id : String, entity : T) : Void add, all : Array(T) all, clear : Void clear, get(id : String) : T | Nil get, remove(id : String) : Bool remove, size : Int32 size

Instance Method Detail

def add(name : String, channel : Domain::Channel) : Void #

[View source]
def add_channel_mode(channel_name : String, mode : Char) : Bool #

[View source]
def all : Array(Domain::Channel) #

[View source]
def cleanup_empty_channels : Int32 #

[View source]
def clear : Void #

[View source]
def count : Int32 #

[View source]
def create_channel(name : String) : Domain::Channel #

Channel-specific operations


[View source]
def exists?(name : String) : Bool #

[View source]
def find_channels_with_local_users(user_repository : UserRepository) : Array(Domain::Channel) #

[View source]
def find_user_channels(nickname : String) : Array(Domain::Channel) #

Query methods


[View source]
def get(name : String) : Domain::Channel | Nil #

[View source]
def get_channel_users(channel_name : String) : Array(String) #

[View source]
def get_user_modes_in_channel(channel_name : String, nickname : String) : Set(Char) | Nil #

[View source]
def join_user(channel_name : String, nickname : String, password : String | Nil = nil, modes : Set(Char) = Set(Char).new) : Bool #

Unified join method that handles both password and modes


[View source]
def part_user(channel_name : String, nickname : String) : Bool #

[View source]
def remove(name : String) : Bool #

[View source]
def remove_channel_mode(channel_name : String, mode : Char) : Bool #

[View source]
def remove_user_from_all_channels(nickname : String) : Array(String) #

Bulk operations


[View source]
def set_topic(channel_name : String, topic : String, set_by : String) : Bool #

[View source]
def set_user_mode(channel_name : String, nickname : String, mode : Char, add : Bool) : Bool #

[View source]
def size : Int32 #

[View source]
def statistics : Hash(Symbol, Int32) #

Statistics


[View source]
def user_in_channel?(channel_name : String, nickname : String) : Bool #

[View source]
def user_operator?(channel_name : String, nickname : String) : Bool #

[View source]
def user_voiced?(channel_name : String, nickname : String) : Bool #

[View source]