Method: Cinch::Ban#initialize

Defined in:
lib/cinch/ban.rb

#initialize(mask, by, at) ⇒ Ban

Returns a new instance of Ban.

Parameters:

  • mask (String, Mask)

    The mask

  • by (User, nil)

    The user who created the ban.

  • at (Time)

    The time at which the ban was created



25
26
27
28
29
30
31
32
33
34
# File 'lib/cinch/ban.rb', line 25

def initialize(mask, by, at)
  @by, @created_at = by, at
  if mask =~ /^[\$~]/
    @extended = true
    @mask     = mask
  else
    @extended = false
    @mask = Mask.from(mask)
  end
end