recordx 0.1.14 → 0.1.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b5d1d7662e40d7ae71f5fd5361aa35a8cba0754a
4
- data.tar.gz: 839f8f2d2e38751ea2e0f5e7f80627a95ad13b3d
3
+ metadata.gz: 632f800ab1d6c0e67d1c691d81fd9229dc61f915
4
+ data.tar.gz: a40f1f9abcfd50cb6deedd68c15d1ffa58e5c93a
5
5
  SHA512:
6
- metadata.gz: bb3267c4afc42373c806e3799377874ef2eafdfcc82a5d4b8c02d65110764bd58f19c24823904c6d7f63ca4fb2e0f27b5f98475ca9b0986469bb93a916fe2a87
7
- data.tar.gz: fd1c549c6ab0dbd5b3b03829b2a3866c76e28a582222dc8924bb0a518e10a5345219582d8f4327a73ed70acbaee8c865cb05f305841212a0187bb7303e61b04a
6
+ metadata.gz: 59117baa7d78fc6a97512350c495eccfec7ddad34600f4c9fab1595fac47d4b4dc4b0d01a9143d74d56d62497d730c86742b462371d3b50b1403997c79988c86
7
+ data.tar.gz: 055c54a602a08001afcfb12650f97f97e3c0b4a9ab60e39c22e32752c1e7d83f956fb128f4b1cd3d07402b6f72f688eeb25b436f46febf713eb7bf04b960ae0e
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/recordx.rb CHANGED
@@ -26,6 +26,13 @@ class RecordX
26
26
  @h = RXHash.new(self).merge h
27
27
  h.each {|name,val| attr_accessor2(name.to_s, val) }
28
28
  end
29
+
30
+ def [](k) @h[k] end
31
+ def []=(k,v) @h[k] = v end
32
+ def keys() @h.keys end
33
+ def values() @h.keys end
34
+ def each(&blk) @h.each(&blk) end
35
+ alias each_pair each
29
36
 
30
37
  def delete()
31
38
  @callerx.delete @id
@@ -48,11 +55,7 @@ class RecordX
48
55
  private
49
56
 
50
57
  def method_missing(method_name, *raw_args)
51
-
52
- if method_name == :[] or method_name == :[]= then
53
- return @h.send(method_name, *raw_args)
54
- end
55
-
58
+
56
59
  arg = raw_args.length > 0 ? raw_args.first : nil
57
60
  attr_accessor2(method_name[/\w+/], arg)
58
61
  arg ? self.send(method_name, arg) : self.send(method_name)
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: recordx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.14
4
+ version: 0.1.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  g/vV/A8D1m4ZGF1z7lQzfOsK5R3XRIJ6zJRYEtb1xhRDDpaYlAPTZloddBDAGxec
32
32
  p6U4INBFsda75Q==
33
33
  -----END CERTIFICATE-----
34
- date: 2015-02-24 00:00:00.000000000 Z
34
+ date: 2015-02-25 00:00:00.000000000 Z
35
35
  dependencies: []
36
36
  description:
37
37
  email: james@r0bertson.co.uk
@@ -63,5 +63,5 @@ rubyforge_project:
63
63
  rubygems_version: 2.2.2
64
64
  signing_key:
65
65
  specification_version: 4
66
- summary: recordx
66
+ summary: A kind of Hash which can also use accessor methods to store or retrieve values.
67
67
  test_files: []
metadata.gz.sig CHANGED
Binary file