Class: Rmpd::SingleResponse

Inherits:
Response
  • Object
show all
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

#error

Instance Method Summary collapse

Methods inherited from Response

#ack?, choose_strategy, factory, #marshal_dump, #marshal_load, #ok?, #parse

Constructor Details

#initializeSingleResponse

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