Class: Cinch::Ban
- Inherits:
-
Object
- Object
- Cinch::Ban
- Defined in:
- lib/cinch/ban.rb
Instance Attribute Summary collapse
- #by ⇒ User readonly
- #created_at ⇒ Time readonly
-
#extended ⇒ Boolean
readonly
Whether this is an extended ban (as used by for example Freenode).
- #mask ⇒ Mask, String readonly
Instance Method Summary collapse
-
#initialize(mask, by, at) ⇒ Ban
constructor
A new instance of Ban.
-
#match(user) ⇒ Boolean
(also: #=~)
True if the ban matches ‘user`.
- #to_s ⇒ String
Constructor Details
Instance Attribute Details
#created_at ⇒ Time (readonly)
11 12 13 |
# File 'lib/cinch/ban.rb', line 11 def created_at @created_at end |
#extended ⇒ Boolean (readonly)
Returns whether this is an extended ban (as used by for example Freenode).
14 15 16 |
# File 'lib/cinch/ban.rb', line 14 def extended @extended end |
Instance Method Details
#match(user) ⇒ Boolean Also known as: =~
Returns true if the ban matches ‘user`.
33 34 35 36 |
# File 'lib/cinch/ban.rb', line 33 def match(user) raise UnsupportedFeature, "extended bans (freenode) are not supported yet" if @extended @mask =~ user end |