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 +4 -4
- data/lib/prezzo/context.rb +9 -2
- data/lib/prezzo/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4024e503a6013386b6152eca67b153e8a589142
|
4
|
+
data.tar.gz: 9b05c3ae7a3ad5726a0242625f3b344380b1012d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd6769df51690e9b383e6796e87074a8f0876501fc651aa5678079bfa42e004a94a6452de3da3887bf66e7327b51a338ac98f51ee5fa8a391fa2d3fc8deafb18
|
7
|
+
data.tar.gz: f9b61e71600dc736a463c660623f60d5b23bbbbe1d04b8420a2ace0a4fa9aac2ae6220135f6da8c9aa25139e8381863dcc31b9c318e817ef0bd5a75bb868a137
|
data/lib/prezzo/context.rb
CHANGED
@@ -16,8 +16,15 @@ module Prezzo
|
|
16
16
|
validation.errors
|
17
17
|
end
|
18
18
|
|
19
|
-
def fetch(
|
20
|
-
|
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
|
data/lib/prezzo/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2017-02-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hanami-validations
|