corraios 0.0.5 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +3 -0
- data/README.md +5 -1
- data/lib/corraios/containers/base.rb +6 -0
- data/lib/corraios/containers/package.rb +1 -0
- data/lib/corraios/packer.rb +3 -2
- data/lib/corraios/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: 1da6dbdd38ca9a24bcd8fed2d500bb1c41206c33
|
4
|
+
data.tar.gz: 3021f12d24b7428221c59cc1e5986afc96ee34db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20afedbe71d98001e1282c92c606352bcdf4bb7e133688a12781ecc5a51514bf9cdbca5d3b0ea581af0345518f0e701a9755117041c4844804ff42b8a607e2d1
|
7
|
+
data.tar.gz: 1bbebc98833b501cda7d43942bdd9dd752506892733a45718f2a599f5ae4269742c92e17ee4d472bdd4b55a0d17f32c81c5b54867f91d33215d6ed38b297a0e7
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,7 +1,11 @@
|
|
1
|
-
# Corraios
|
1
|
+
# Corraios [![Gem Version](https://badge.fury.io/rb/corraios.svg)](http://badge.fury.io/rb/corraios)
|
2
2
|
|
3
3
|
[ ![Codeship Status for imaboldcompany/corrails](https://codeship.com/projects/b77b8780-9531-0132-ffbf-466960a0e7d2/status?branch=master)](https://codeship.com/projects/62768)
|
4
4
|
|
5
|
+
[![Code Climate](https://codeclimate.com/github/imaboldcompany/corraios/badges/gpa.svg)](https://codeclimate.com/github/imaboldcompany/corraios)
|
6
|
+
|
7
|
+
[![Test Coverage](https://codeclimate.com/github/imaboldcompany/corraios/badges/coverage.svg)](https://codeclimate.com/github/imaboldcompany/corraios)
|
8
|
+
|
5
9
|
gem que visa facilitar o cálculo do valor do frete cobrado pelo Correios para entregas
|
6
10
|
simples e para entregas com multiplos itens.
|
7
11
|
|
@@ -38,6 +38,12 @@ module Corraios
|
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
|
+
def assert_minimum_measures!
|
42
|
+
attributes_names.each do |attr|
|
43
|
+
send("#{attr}=", self.class.floor_for(attr, send(attr)))
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
41
47
|
class << self
|
42
48
|
|
43
49
|
def add_attribute name, restrictions, query_attribute_name = nil, round_value = true
|
data/lib/corraios/packer.rb
CHANGED
@@ -33,7 +33,8 @@ module Corraios
|
|
33
33
|
@containers << container
|
34
34
|
else
|
35
35
|
if container.is_a? :package
|
36
|
-
|
36
|
+
convert_containers_into_package unless using_package?
|
37
|
+
add_package(container)
|
37
38
|
else
|
38
39
|
add_envelope_or_roll container
|
39
40
|
end
|
@@ -69,7 +70,7 @@ module Corraios
|
|
69
70
|
end
|
70
71
|
|
71
72
|
def using_package?
|
72
|
-
@containers.
|
73
|
+
@containers.all? { |container| container.is_a? :package }
|
73
74
|
end
|
74
75
|
|
75
76
|
def using_envelope?
|
data/lib/corraios/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: corraios
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rodrigo Ra
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|