prezzo 0.2.0 → 0.2.1

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: 9b0833080b15f848d5af74f370de06f7b7e01f99
4
- data.tar.gz: 84b4ba0a6ab9cde6acd3b712ea34a4454d0eb64d
3
+ metadata.gz: e4024e503a6013386b6152eca67b153e8a589142
4
+ data.tar.gz: 9b05c3ae7a3ad5726a0242625f3b344380b1012d
5
5
  SHA512:
6
- metadata.gz: ccf84eb848f89a21583cffedccdf39964e8cc747d8a883d28001652467b9d4f476930d236610aac02cd753dd3ca935b59e1b6d7a9699eb878158cbff78298b10
7
- data.tar.gz: a10f803a910e9f2b5a91eeddef07a98e269844f77a5bb06de1b60431caf9fffea04d071f60bcde3114e586ac6bff92eb8ffe1810b45158e29d98e3d52ed64e78
6
+ metadata.gz: bd6769df51690e9b383e6796e87074a8f0876501fc651aa5678079bfa42e004a94a6452de3da3887bf66e7327b51a338ac98f51ee5fa8a391fa2d3fc8deafb18
7
+ data.tar.gz: f9b61e71600dc736a463c660623f60d5b23bbbbe1d04b8420a2ace0a4fa9aac2ae6220135f6da8c9aa25139e8381863dcc31b9c318e817ef0bd5a75bb868a137
@@ -16,8 +16,15 @@ module Prezzo
16
16
  validation.errors
17
17
  end
18
18
 
19
- def fetch(*args)
20
- attributes.fetch(*args)
19
+ def fetch(key, default = nil)
20
+ if default.nil?
21
+ value = attributes.fetch(key)
22
+ else
23
+ value = attributes.fetch(key, default)
24
+ value = default if value.nil?
25
+ end
26
+
27
+ value
21
28
  end
22
29
 
23
30
  def attributes
@@ -1,3 +1,3 @@
1
1
  module Prezzo
2
- VERSION = "0.2.0".freeze
2
+ VERSION = "0.2.1".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prezzo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcelo Boeira
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-23 00:00:00.000000000 Z
11
+ date: 2017-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hanami-validations