pinkman 1.4.2 → 1.4.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 83fbbd3c2199953771dcc5d4a2b3d576a95a826335d4e4c6cb1a91f285e38be0
4
- data.tar.gz: 7dd126c2f71f854815ccd087e33a73c8b0cd5cec48ac633c100b6177e4fd5364
3
+ metadata.gz: 291782b4b04a02a359d5cecaccf2c67b3c4d2c3f2b269e6bb607d949e6ecd180
4
+ data.tar.gz: 58a64ecaf2dab1df27e8d1d3d07563efcec47cd7e318fc38b2b9c52302cdecc4
5
5
  SHA512:
6
- metadata.gz: 21f20df4281baab2707b0e10a87ad901534bac7bd5328cb5ab5965cd2fca8f39a493e9d4ead8ab6b1b9f2d7f866e4cd8c2b2f795352b80046f4ee6d1a353bcc7
7
- data.tar.gz: 02ca3adb0d09c8bebc9b88db3e2d37e432e383bbca7b9057831344b80247bac297e9e6f0e79aca07d21017949d7f2bc9b8817f1d223e31d4f2b206d0e34dad17
6
+ metadata.gz: 609f4254349dbcc6b21a164d7cfd4c998d92daa64df054ea20318f977feaa759bb0a128627c1f2eb6070a7dea2d4eb837e5d6a368ec43135185e2e416203a3ee
7
+ data.tar.gz: 3715ca1976c898dc5bd8151dc954ab9bb453ff99e224fd7b158ebdbad99ebda66238a3251b8f58145a29ec9e5af88192be2c953e1067b669fbb2878cfa6bd3c6
@@ -94,6 +94,18 @@ class window.PinkmanCollection extends window.PinkmanCommon
94
94
  transformation(o)
95
95
  callback(this) if (i == @count()) and typeof callback == 'function'
96
96
  return this
97
+
98
+ # rails/ruby equivalent: map
99
+ # Desc: receive a function and apply it to all members and returns an array of values
100
+ map: (transformation='',callback) ->
101
+ array = []
102
+ if transformation? and typeof transformation=='function'
103
+ i = 0
104
+ for o in @collection
105
+ i = i+1
106
+ array.push(transformation(o))
107
+ callback(array) if (i == @count()) and typeof callback == 'function'
108
+ return array
97
109
 
98
110
  # rails/ruby equivalent: where/select
99
111
  # Desc: returns a new collection of all members that satisfies a criteria (criteria(obj) returns true)
@@ -1,3 +1,3 @@
1
1
  module Pinkman
2
- VERSION = "1.4.2"
2
+ VERSION = "1.4.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pinkman
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.2
4
+ version: 1.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Agilso Oliveira
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-08-14 00:00:00.000000000 Z
11
+ date: 2019-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -322,7 +322,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
322
322
  - !ruby/object:Gem::Version
323
323
  version: '0'
324
324
  requirements: []
325
- rubygems_version: 3.0.3
325
+ rubygems_version: 3.0.6
326
326
  signing_key:
327
327
  specification_version: 4
328
328
  summary: Small Rails-js framework.