Class: Rmpd::SingleResponse
- Defined in:
- lib/rmpd/response.rb
Constant Summary
Constants inherited from Response
Response::KEY_VALUE_RE, Response::KNOWN_COMPLEX_FIELDS, Response::KNOWN_FLOAT_FIELDS, Response::KNOWN_INT_FIELDS, Response::MULTI_RESPONSE_COMMANDS
Instance Attribute Summary
Attributes inherited from Response
Instance Method Summary collapse
-
#initialize ⇒ SingleResponse
constructor
A new instance of SingleResponse.
- #register_key_val_pair(match_data) ⇒ Object
Methods inherited from Response
#ack?, choose_strategy, factory, #marshal_dump, #marshal_load, #ok?, #parse
Constructor Details
#initialize ⇒ SingleResponse
Returns a new instance of SingleResponse.
172 173 174 |
# File 'lib/rmpd/response.rb', line 172 def initialize super(NilHash.new) end |
Instance Method Details
#register_key_val_pair(match_data) ⇒ Object
176 177 178 179 180 181 182 |
# File 'lib/rmpd/response.rb', line 176 def register_key_val_pair(match_data) key = match_data[1].downcase val = transform_value(key, match_data[2]) self[key] = include?(key) ? ([self[key]] << val).flatten : val define_getter(key) end |