Class: Net::IRC::RplIsupport::Parameter
- Inherits:
-
Object
- Object
- Net::IRC::RplIsupport::Parameter
- Defined in:
- lib/net/irc.rb
Constant Summary collapse
- PARAMETER_REGEX =
/^(-)?([[:alnum:]]{1,20})(?:=(.*))?/
Instance Method Summary collapse
-
#initialize(param) ⇒ Parameter
constructor
A new instance of Parameter.
- #name ⇒ Object
- #value ⇒ Object
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
#name ⇒ Object
322 323 324 |
# File 'lib/net/irc.rb', line 322 def name @matches[2] end |
#value ⇒ Object
326 327 328 |
# File 'lib/net/irc.rb', line 326 def value @matches[3] || @matches[1].nil? end |