Class: ModSpox::Models::NickMode

Inherits:
Sequel::Model
  • Object
show all
Defined in:
lib/mod_spox/models/NickMode.rb

Instance Method Summary collapse

Instance Method Details

#clear_modesObject

clear all modes for a nick channel combo



27
28
29
# File 'lib/mod_spox/models/NickMode.rb', line 27

def clear_modes
    update(:mode => '')
end

#set?(m) ⇒ Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/mod_spox/models/NickMode.rb', line 22

def set?(m)
    return mode.nil? ? false : !mode.index(m).nil?
end

#set_mode(m) ⇒ Object

m

mode character

add a mode for a nick channel combo



12
13
14
# File 'lib/mod_spox/models/NickMode.rb', line 12

def set_mode(m)
    update(:mode => "#{values[:mode]}#{m}") if values[:mode].nil? || values[:mode].index(m).nil?
end

#unset_mode(m) ⇒ Object

m

mode character

remove a mode for a nick channel combo



18
19
20
# File 'lib/mod_spox/models/NickMode.rb', line 18

def unset_mode(m)
    update(:mode => values[:mode].gsub(m, ''))
end