wedge 0.1.19 → 0.1.20

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: 743fe18c109f6fc6b16b080ed8513410c3a858d7
4
- data.tar.gz: 80dd49ce133ea492f59f2984153312677e0b50a0
3
+ metadata.gz: 164e8c7334f161e44b6a9770b12ed5a8e5d6be0d
4
+ data.tar.gz: b7db45c79f2c49cc7238742a66623ddd141bd2ff
5
5
  SHA512:
6
- metadata.gz: eae83cd5489b454594342920755d20fe11d8bc7f6720875276668d022f086c36cb3511949c5173a9a1f75d91ef104caf1ccfd9cc441c5d525d423c4f0c1d9cea
7
- data.tar.gz: 37db72b69386af0096898d6370d12d6a2ed6a78c2c97f9d35420d80c831bcc0d91c16ba21465a54a824457c7489d4deacd268a2d4ac1793275f1db35d5e0a7d2
6
+ metadata.gz: 5e478d89243b932942747ed53637b06d2e821475cf7d167b3d7efb109dfe1290a791a44db4fa9bfabed2ff00791cad6195bef947c07ceb6dfb8f500d62dbf7ef
7
+ data.tar.gz: e81c3747ba066a1365ee620dcd703a7a54a6ce39cce2b37b24bd04eaece714b0cf55d688fa4319893b1fa432fcf72cbcb033379f74534c46f9cce3285298ca7a
@@ -9,6 +9,8 @@ class Wedge
9
9
  include Methods
10
10
  include Validations
11
11
  include Render
12
+ include Enumerable
13
+ extend Forwardable
12
14
 
13
15
  # This allows us to call super
14
16
  module Delegates
@@ -310,6 +312,9 @@ class Wedge
310
312
  end
311
313
  end
312
314
  end
315
+
316
+ # define #each
317
+ def_delegators :attributes, :each
313
318
  end
314
319
  end
315
320
  end
@@ -120,7 +120,7 @@ class Wedge
120
120
  # when the validation fails.
121
121
  def assert_format(att, format, error = [att, :format])
122
122
  if !send(att).to_s.empty?
123
- assert(_attributes.send(att).to_s.match(format), error)
123
+ assert(atts.send(att).to_s.match(format), error)
124
124
  end
125
125
  end
126
126
 
@@ -196,12 +196,12 @@ class Wedge
196
196
  end
197
197
 
198
198
  def assert_member(att, set, err = [att, :not_valid])
199
- assert(set.include?(_attributes.send(att)), err)
199
+ assert(set.include?(atts.send(att)), err)
200
200
  end
201
201
 
202
202
  def assert_length(att, range, error = [att, :not_in_range])
203
203
  if !send(att).to_s.empty?
204
- val = _attributes.send(att).to_s
204
+ val = atts.send(att).to_s
205
205
  assert range.include?(val.length), error
206
206
  end
207
207
  end
@@ -234,7 +234,7 @@ class Wedge
234
234
  # @param [Array<Symbol, Symbol>] error The error that should be returned
235
235
  # when the validation fails.
236
236
  def assert_equal(att, value, error = [att, :not_equal])
237
- assert value === _attributes.send(att), error
237
+ assert value === atts.send(att), error
238
238
  end
239
239
 
240
240
  # The grand daddy of all assertions. If you want to build custom
data/lib/wedge/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Wedge
2
- VERSION = '0.1.19'
2
+ VERSION = '0.1.20'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wedge
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.19
4
+ version: 0.1.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - cj