tarvit-helpers 0.0.21 → 0.0.22

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
  SHA1:
3
- metadata.gz: e09d3174c8b6ed141630679bc0566ac741ddfff8
4
- data.tar.gz: 1bfda782f003b56ddc7809471ef1333e9c9d6d2f
3
+ metadata.gz: caa66ce8ca236d132715e53cc7895f433a0755e4
4
+ data.tar.gz: 4ecc3de185ae7a4e57bbf938c67e5d51ddb73ab6
5
5
  SHA512:
6
- metadata.gz: 57c405ec703cbf1d9eb1bd05de877b06972b58e9fa6212ea8674d3e64f167822503ce3051eaadd11afd56c27a2f07c5e928cca9ae847b4fe89f0cf555508120a
7
- data.tar.gz: e4d3ac1382ffcaf9b0e4383594092021b5e902aee2a29e79d5c75e1394d2c3c0341f59c30d6d89b5476454896724e68f16b1defe5d7794647656099bad69bf6d
6
+ metadata.gz: fe34c1d4c4ac253edf4bd2eb4ab3ab585af0d121d91715c4adddd4c80155bf3461f8db68a37b8800c57eeb667c15cf4bdfa69be8a4c06ec0b3b3997ef18d46ad
7
+ data.tar.gz: 6503d663d1c6cc53c259c1abb134b3cc9f2f3d52bf3cf880e1d3c1ac27f55eaf7cb483bfcb191a1638d34b34bdf800a23b478afb9192d8b99fba778d83a6696e
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.21
1
+ 0.0.22
@@ -7,7 +7,7 @@ module TarvitHelpers
7
7
  attr_reader :_hash, :_levels, :_parent
8
8
 
9
9
  def initialize(hash, levels=[], parent=nil)
10
- @_hash = _prepare_keys(hash)
10
+ @_hash = _modify_hash(_prepare_keys(hash))
11
11
  @_levels = levels
12
12
  @_parent = parent
13
13
  end
@@ -62,6 +62,10 @@ module TarvitHelpers
62
62
  def _new_level_presenter_klass
63
63
  self.class
64
64
  end
65
+
66
+ def _modify_hash(hash)
67
+ hash
68
+ end
65
69
  end
66
70
  end
67
71
  end
@@ -73,6 +73,12 @@ describe HashPresenter::Custom do
73
73
 
74
74
  class AccountsPresenter < HashPresenter::Custom
75
75
 
76
+ def _modify_hash(hash)
77
+ res = super(hash)
78
+ res[:extra] = :value
79
+ res
80
+ end
81
+
76
82
  def _add_rules(rules)
77
83
  rules.when([:accounts, :name]) do |value|
78
84
  value.to_s
@@ -110,6 +116,8 @@ describe HashPresenter::Custom do
110
116
  expect(account.collections[1].folder).to eq('folders/BestCollection')
111
117
  expect(account.collections[1].global_folder).to eq('director/folders/BestCollection')
112
118
 
119
+ expect(@presenter.extra).to eq(:value)
120
+
113
121
  expect(@presenter._custom_hash).to eq({
114
122
  :accounts => [
115
123
  {
@@ -121,7 +129,8 @@ describe HashPresenter::Custom do
121
129
  ],
122
130
  :website=>'www.johndoe.com/director'
123
131
  }
124
- ]
132
+ ],
133
+ :extra => :value,
125
134
  })
126
135
  end
127
136
  end
@@ -2,11 +2,11 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: tarvit-helpers 0.0.21 ruby lib
5
+ # stub: tarvit-helpers 0.0.22 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "tarvit-helpers"
9
- s.version = "0.0.21"
9
+ s.version = "0.0.22"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tarvit-helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.21
4
+ version: 0.0.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vitaly Tarasenko