Class: Dragoon::Receiver

Inherits:
String
  • Object
show all
Defined in:
lib/dragoon/receiver.rb

Overview

RFC 1459 section 4.4.1

a receiver can be

a nickname,
a channel

Instance Method Summary collapse

Methods inherited from String

#escape_double_quotes

Constructor Details

#initialize(raw_string) ⇒ Receiver

Returns a new instance of Receiver.



10
11
12
# File 'lib/dragoon/receiver.rb', line 10

def initialize(raw_string)
  super(raw_string)
end

Instance Method Details

#channel?Boolean

checks if first character of is #

Returns:

  • (Boolean)


14
15
16
# File 'lib/dragoon/receiver.rb', line 14

def channel?
  self[0].chr == "#"
end

#nickname?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/dragoon/receiver.rb', line 18

def nickname?
  !channel?
end