rmpd 1.1.6 → 1.1.7

Sign up to get free protection for your applications and to get access to all the features.
data/lib/rmpd/response.rb CHANGED
@@ -69,6 +69,15 @@ module Rmpd
69
69
  @error = nil
70
70
  end
71
71
 
72
+ def marshal_dump
73
+ [@delegate_sd_obj, @error]
74
+ end
75
+
76
+ def marshal_load(array)
77
+ @delegate_sd_obj, @error = array
78
+ each {|k, v| define_getter(k)}
79
+ end
80
+
72
81
  def ok?
73
82
  @error.nil?
74
83
  end
@@ -119,6 +128,10 @@ module Rmpd
119
128
  value.split(":", 3).map(&:to_i)
120
129
  end
121
130
 
131
+ def define_getter(key)
132
+ self.class.send(:define_method, key.to_s.gsub(/-/, "_")) {self[key]}
133
+ end
134
+
122
135
  end
123
136
 
124
137
  class MultiResponse < Response
@@ -146,7 +159,7 @@ module Rmpd
146
159
  else
147
160
  @first_key ||= key
148
161
  @temp[key] = val
149
- @temp.class.send(:define_method, key.to_s.gsub(/-/, "_")) {self[key]}
162
+ define_getter(key)
150
163
  end
151
164
  end
152
165
 
@@ -163,7 +176,7 @@ module Rmpd
163
176
  val = transform_value(key, match_data[2])
164
177
 
165
178
  self[key] = include?(key) ? ([self[key]] << val).flatten : val
166
- self.class.send(:define_method, key.to_s.gsub(/-/,"_")) {self[key]}
179
+ define_getter(key)
167
180
  end
168
181
 
169
182
  end
data/lib/rmpd/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Rmpd
2
- VERSION = "1.1.6"
2
+ VERSION = "1.1.7"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rmpd
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 1
9
- - 6
10
- version: 1.1.6
9
+ - 7
10
+ version: 1.1.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Eric Wollesen
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2013-03-01 00:00:00 Z
18
+ date: 2013-03-04 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: rspec