Class: ModSpox::Models::NickMode
- Inherits:
-
Sequel::Model
- Object
- Sequel::Model
- ModSpox::Models::NickMode
- Defined in:
- lib/mod_spox/models/NickMode.rb
Instance Method Summary collapse
-
#clear_modes ⇒ Object
clear all modes for a nick channel combo.
- #set?(m) ⇒ Boolean
-
#set_mode(m) ⇒ Object
- m
-
mode character add a mode for a nick channel combo.
-
#unset_mode(m) ⇒ Object
- m
-
mode character remove a mode for a nick channel combo.
Instance Method Details
#clear_modes ⇒ Object
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
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 |