Class: Quaff::ABNFSipParser
Overview
:nodoc:
Direct Known Subclasses
Instance Method Summary collapse
- #addr_spec ⇒ Object
-
#alphanum ⇒ Object
Rules.
- #display_name ⇒ Object
- #escaped ⇒ Object
- #from_param ⇒ Object
- #from_spec ⇒ Object
- #hostname ⇒ Object
- #hostport ⇒ Object
- #laquot ⇒ Object
- #lws ⇒ Object
- #mark ⇒ Object
- #name_addr ⇒ Object
- #param ⇒ Object
- #paramchar ⇒ Object
- #pname ⇒ Object
- #port ⇒ Object
- #pvalue ⇒ Object
- #raquot ⇒ Object
- #reserved ⇒ Object
- #sip_uri ⇒ Object
- #sws ⇒ Object
- #to_param ⇒ Object
- #to_spec ⇒ Object
- #unreserved ⇒ Object
- #uri_parameters ⇒ Object
- #user ⇒ Object
- #user_unreserved ⇒ Object
- #userinfo ⇒ Object
- #wsp ⇒ Object
Instance Method Details
#addr_spec ⇒ Object
181 182 183 |
# File 'lib/sip_parser.rb', line 181 def addr_spec sip_uri end |
#alphanum ⇒ Object
Rules
107 108 109 |
# File 'lib/sip_parser.rb', line 107 def alphanum Alternate.new(Alpha.new, Digit.new) end |
#display_name ⇒ Object
205 206 207 |
# File 'lib/sip_parser.rb', line 205 def display_name Repetition.new(:any, Alternate.new(alphanum, wsp, Char.new(?"))) end |
#escaped ⇒ Object
123 124 125 |
# File 'lib/sip_parser.rb', line 123 def escaped Concat.new(Char.new(?%), HexDigit.new, HexDigit.new) end |
#from_param ⇒ Object
213 214 215 |
# File 'lib/sip_parser.rb', line 213 def from_param param end |
#from_spec ⇒ Object
217 218 219 |
# File 'lib/sip_parser.rb', line 217 def from_spec Concat.new(Alternate.new(addr_spec, name_addr), Repetition.new(:any, Concat.new(Char.new(?;), from_param))) end |
#hostname ⇒ Object
139 140 141 |
# File 'lib/sip_parser.rb', line 139 def hostname Repetition.new([:at_least, 1], Alternate.new(alphanum, Char.new(?.))) end |
#hostport ⇒ Object
147 148 149 |
# File 'lib/sip_parser.rb', line 147 def hostport Concat.new(hostname, OptionalConcat.new(Char.new(?:), port)) end |
#laquot ⇒ Object
201 202 203 |
# File 'lib/sip_parser.rb', line 201 def laquot Concat.new(sws, Char.new("<")) end |
#lws ⇒ Object
189 190 191 |
# File 'lib/sip_parser.rb', line 189 def lws Concat.new(OptionalConcat.new(Repetition.new([:at_least, 1], wsp), Literal.new("\r\n")), Repetition.new([:at_least, 1], wsp)) end |
#mark ⇒ Object
115 116 117 |
# File 'lib/sip_parser.rb', line 115 def mark AlternateChars.new("-_.!~*'()") end |
#name_addr ⇒ Object
209 210 211 |
# File 'lib/sip_parser.rb', line 209 def name_addr Concat.new(display_name, laquot, addr_spec, raquot) end |
#param ⇒ Object
165 166 167 |
# File 'lib/sip_parser.rb', line 165 def param Concat.new(pname, OptionalConcat.new(Char.new(?=), pvalue)) end |
#paramchar ⇒ Object
151 152 153 154 |
# File 'lib/sip_parser.rb', line 151 def paramchar paramunreserved = AlternateChars.new("[]/:&+%") Alternate.new(paramunreserved, unreserved, escaped) end |
#pname ⇒ Object
156 157 158 |
# File 'lib/sip_parser.rb', line 156 def pname Repetition.new([:at_least, 1], paramchar) end |
#port ⇒ Object
143 144 145 |
# File 'lib/sip_parser.rb', line 143 def port Repetition.new([:at_least, 1], Digit.new) end |
#pvalue ⇒ Object
160 161 162 |
# File 'lib/sip_parser.rb', line 160 def pvalue Repetition.new([:at_least, 1], paramchar) end |
#raquot ⇒ Object
197 198 199 |
# File 'lib/sip_parser.rb', line 197 def raquot Concat.new(Char.new(">"), sws) end |
#reserved ⇒ Object
111 112 113 |
# File 'lib/sip_parser.rb', line 111 def reserved AlternateChars.new(";/?:@&=+$,") end |
#sip_uri ⇒ Object
174 175 176 177 178 179 |
# File 'lib/sip_parser.rb', line 174 def sip_uri Concat.new(Literal.new("sip:"), Optional.new(userinfo), hostport, uri_parameters) end |
#sws ⇒ Object
193 194 195 |
# File 'lib/sip_parser.rb', line 193 def sws Optional.new(lws) end |
#to_param ⇒ Object
221 222 223 |
# File 'lib/sip_parser.rb', line 221 def to_param param end |
#to_spec ⇒ Object
225 226 227 |
# File 'lib/sip_parser.rb', line 225 def to_spec Concat.new(Alternate.new(addr_spec, name_addr), Repetition.new(:any, Concat.new(Char.new(?;), from_param))) end |
#unreserved ⇒ Object
119 120 121 |
# File 'lib/sip_parser.rb', line 119 def unreserved Alternate.new(alphanum, mark) end |
#uri_parameters ⇒ Object
169 170 171 172 |
# File 'lib/sip_parser.rb', line 169 def uri_parameters Repetition.new(:any, Concat.new(Char.new(?;), param)) end |
#user ⇒ Object
131 132 133 |
# File 'lib/sip_parser.rb', line 131 def user Repetition.new([:at_least, 1], Alternate.new(unreserved, escaped, user_unreserved)) end |
#user_unreserved ⇒ Object
127 128 129 |
# File 'lib/sip_parser.rb', line 127 def user_unreserved AlternateChars.new "&=+$,;?/" end |
#userinfo ⇒ Object
135 136 137 |
# File 'lib/sip_parser.rb', line 135 def userinfo Concat.new(user, Char.new(?@)) end |
#wsp ⇒ Object
185 186 187 |
# File 'lib/sip_parser.rb', line 185 def wsp Alternate.new(Char.new(" "), Char.new("\t")) end |