In Files

Parent

Methods

Cinch::Ban

Attributes

by[R]

@return [User]

created_at[R]

@return [Time]

extended[R]

@return [Boolean] whether this is an extended ban (as used by for example Freenode)

mask[R]

@return [Mask, String]

Public Class Methods

new(mask, by, at) click to toggle source

@param [String] mask The mask @param [User] by The user who created the ban @param [Time] at The time at which the ban was created

# File lib/cinch/ban.rb, line 19
def initialize(mask, by, at)
  @by, @created_at = by, at
  if mask =~ /^\$/
    @extended = true
    @mask     = mask
  else
    @extended = false
    @mask = Mask.new(mask)
  end
end

Public Instance Methods

=~(user) click to toggle source
Alias for: match
match(user) click to toggle source

@return [Boolean] true if the ban matches `user` @raise [Exceptions::UnsupportedFeature] Cinch does not support

Freenode's extended bans
# File lib/cinch/ban.rb, line 33
def match(user)
  raise UnsupportedFeature, "extended bans (freenode) are not supported yet" if @extended
  @mask =~ user
end
Also aliased as: =~
to_s() click to toggle source

@return [String]

# File lib/cinch/ban.rb, line 40
def to_s
  @mask.to_s
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.