Class: Net::IRC::RplIsupport::Parameter

Inherits:
Object
  • Object
show all
Defined in:
lib/net/irc.rb

Constant Summary collapse

PARAMETER_REGEX =
/^(-)?([[:alnum:]]{1,20})(?:=(.*))?/

Instance Method Summary collapse

Constructor Details

#initialize(param) ⇒ Parameter

Returns a new instance of Parameter.



317
318
319
320
# File 'lib/net/irc.rb', line 317

def initialize(param)
  @param = param
  @matches = param.match(PARAMETER_REGEX)
end

Instance Method Details

#nameObject



322
323
324
# File 'lib/net/irc.rb', line 322

def name
  @matches[2]
end

#valueObject



326
327
328
# File 'lib/net/irc.rb', line 326

def value
  @matches[3] || @matches[1].nil?
end