mobj 2.9.0 → 2.9.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +8 -8
  2. data/lib/ext/array.rb +18 -0
  3. data/lib/ext/hash.rb +7 -0
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YjZlOTBhNjE0NjZlMmU4M2FiNzkwMGFmNjBmNzhhZDY2ZmJjODZjMA==
4
+ ZWZiODA5NTEzMDc1OWE2ZjM2NzM4NTE3NTM0ZjVmYTc3NjllZWVmMg==
5
5
  data.tar.gz: !binary |-
6
- OGY1YmQwNmYwMzc2NzVjYWRlZGY1OWYwN2RlODQ1ZGQyYWRkYzIwOA==
6
+ OGM1ZDM3ZjVmMGU3ZDRiNTJhYjJjMTM1ZjZmOTAwMmQ3MzFiZTAxOA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NzE4MzMxNDZmZjUzYWE3NDE0YThjM2ZmODQ5ZDAyOWM3MmRmYmUxMTM1YTM3
10
- ZGVhOWYzNjhjYzFhYmQ2ZTI2MTkyMzQ4ODM0YzJlMDAwZTVkMzM0NDExNzZh
11
- ZGU4ZDZjMzgzMGM3ODNjMzUyODMyMWVkZDhlOTJlNzdhZmE2OGQ=
9
+ OWY0NWQ2YzNkNmU2ZDA4N2I4M2U4ZDdhYTZhMjFlZDExZDZiMTA0MDM4YWMx
10
+ ZDc2NmQ0ZjJlMWRjYTI4MzQyYTAyZDVlY2NhYjRmZjkzNGQyYWNlM2ZiN2Fk
11
+ MzZmNTEzZjk1Zjc0ZWM4NGRjNmU2MTk2YjM4YWVjZmQ1MDY3NDU=
12
12
  data.tar.gz: !binary |-
13
- NTI4OTAwNjIwMDVlMGIyYzc3YWE3NGE2OGM3YjQ3NDRlNzAwODNlODkxYWY4
14
- NDJiMjY3YWE2MzQ4OTk5Yzg2ZGM5MTg4YTMyNzU3MTY1ODljY2Q0MDFjYTky
15
- YTBjYzQwYWNiMzkzOWY1MmIxYWU5NjE5MzFlNzliMDBmMGQyZjY=
13
+ NTJmOTYzODFkNmU2OTZjMGNkZTZiNmMxZjRjZjE0NjAzNTdjMzQ5MDg5MGU0
14
+ NzdiMTg5ZDk5YTQ5MTM0NDM2MjQ2YzQzMTkyMGIxZWQ2NmMwYjIyZDMzMDc5
15
+ ZTBiZjM0MTk1NTQ0YzRlZWJmMGVkMTViMzUyNzFmODRiOWViNzY=
@@ -46,6 +46,24 @@ module Mobj
46
46
  end
47
47
 
48
48
  alias_method :earliest, :return_first
49
+
50
+ def sym
51
+ map(&:sym)
52
+ end
53
+
54
+ def meach(*args, &block)
55
+ if block
56
+ map { |item| instance_exec(item, *args, &block) }
57
+ elsif args.size == 1
58
+ map(&args.first.sym)
59
+ else
60
+ #args.each.with_object({}) do |action, o|
61
+ # o[action.sym] = map(&action.sym)
62
+ #end
63
+ method = args.shift
64
+ map { |item| item.send(method, *args) }
65
+ end
66
+ end
49
67
  end
50
68
 
51
69
  end
@@ -72,6 +72,13 @@ module Mobj
72
72
  def [](*fkeys)
73
73
  fkeys.map { |key| mlookup(key) || mfetch(key.sym) { mfetch(key.to_s) { mfetch(ki(key).sym) { mfetch(ki(key).to_s) { mdef(key) } } } } }.sequester
74
74
  end
75
+
76
+ def sym(recurse=false)
77
+ each.with_object({}) do |(key, value), o|
78
+ o[key.sym] = recurse ? value.sym : value
79
+ end
80
+ end
81
+
75
82
  end
76
83
 
77
84
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mobj
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.9.0
4
+ version: 2.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mason
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-04-15 00:00:00.000000000 Z
11
+ date: 2013-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec