recordx 0.1.15 → 0.1.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/recordx.rb +12 -2
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb38104cb38491761b5fdf8d3ee8032cda26ca34
|
4
|
+
data.tar.gz: 75e2db97795497d4cca70002476e34332c78e648
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d132a9afee98e3eb86a5510b102225a7e90039a955792eb77ff95985daecc99aa42df0c57633d516d6cf115fb82564cb9b8e9d162fc12a31243a88100d37ce63
|
7
|
+
data.tar.gz: 0483b831e509ffa399c9952b4c7bb791cc59ece280b6d83d1bc237c057e9c2a3a302fe52f2cf818bd5c523dc302fb7d2e6078d709cabee16cbb7e5181bacb8a6
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/recordx.rb
CHANGED
@@ -2,11 +2,13 @@
|
|
2
2
|
|
3
3
|
# file: recordx.rb
|
4
4
|
|
5
|
+
|
5
6
|
class RecordX
|
6
7
|
|
7
8
|
attr_reader :id
|
8
9
|
|
9
10
|
class RXHash < Hash
|
11
|
+
|
10
12
|
def initialize(callerx)
|
11
13
|
super()
|
12
14
|
@callerx = callerx
|
@@ -20,8 +22,16 @@ class RecordX
|
|
20
22
|
end
|
21
23
|
end
|
22
24
|
|
23
|
-
def initialize(
|
25
|
+
def initialize(x=nil, callerx=nil, id=nil )
|
24
26
|
|
27
|
+
h = if x.is_a? Hash then
|
28
|
+
x
|
29
|
+
elsif x.is_a? Array and x.first.is_a? Rexle::Element then
|
30
|
+
x.inject({}) {|r,y| r.merge(y.name.to_sym => y.text.unescape)}
|
31
|
+
else
|
32
|
+
x
|
33
|
+
end
|
34
|
+
|
25
35
|
@callerx, @id = callerx, id
|
26
36
|
@h = RXHash.new(self).merge h
|
27
37
|
h.each {|name,val| attr_accessor2(name.to_s, val) }
|
@@ -43,7 +53,7 @@ class RecordX
|
|
43
53
|
end
|
44
54
|
|
45
55
|
def inspect()
|
46
|
-
"
|
56
|
+
"#<RecordX:%s>" % [self.object_id]
|
47
57
|
end
|
48
58
|
|
49
59
|
alias to_h h
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|