me_api 1.0.1 → 1.1.0

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
  SHA256:
3
- metadata.gz: c018a543c6d96c95c8d5110ab949c8f7af53c478c2e2ddfcc761382d9bf38cd8
4
- data.tar.gz: 7615b66c73e1aeb659646567828f9d09a3ed6cda61d9c6d8c6f4dba094dcd565
3
+ metadata.gz: c6d1f29b9dbc52900ec643b65410cae1b2a026f6c0c68d43ec9e6bfc214df478
4
+ data.tar.gz: a1478841444ac4ed8ef9ab1f100fec4c70c6cee31c603ae9c4eb899c4affdcee
5
5
  SHA512:
6
- metadata.gz: 8c83c1bece8bb5b7e3c251a3a8ce1f4d19f3bc5b7f03916456f94225ed23beab97f4c0cf5c4699758678e9478ba8e82fc8172f54f4b5e8f8d746926087b365bf
7
- data.tar.gz: 0f9e45675f298603e5473dba684f316903bc29359628fefcfd94058ee8e009c94c9c36bf93a6632f9f1331d5a807818d9aede6efaf48d72a97b0644c7ad21a5c
6
+ metadata.gz: a31fa758d1e54d5f57f545d5c2f082abe1c7ab1fdd1c8274554be2531727ee6fa895e7e3759fc6ac78e93f7ff09c8d048f1d04297e03e439e90625ea6ba41b49
7
+ data.tar.gz: b45a72ec552139fa66eed1e4faaafe7538f2f65d0e8293582ffa7d2a189f85efe5007633d7e89b3836bc90b3162c0a0011c6522417b0282f2a954c3944d3f972
data/lib/me_api/client.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module MeApi
2
2
  class Client < Ac::Base
3
3
  BASE_URL = "https://melhorenvio.com.br"
4
- Rate = Data.define(:id, :from, :to, :price, :delivery_range, :service_name, :carrier_name, :carrier_logo_url)
4
+ Rate = Data.define(:id, :from, :to, :price, :min_delivery_time, :max_delivery_time, :service_name, :carrier_name, :carrier_logo_url)
5
5
 
6
6
  attr_reader :default_height, :default_width, :default_length
7
7
  def initialize(access_token = nil, default_height: 24, default_width: 16, default_length: 10)
@@ -39,7 +39,8 @@ module MeApi
39
39
  from: from,
40
40
  to: to,
41
41
  price: rate["price"].to_f,
42
- delivery_range: rate["delivery_range"],
42
+ min_delivery_time: rate.dig("delivery_range", "min"),
43
+ max_delivery_time: rate.dig("delivery_range", "max"),
43
44
  service_name: rate["name"],
44
45
  carrier_name: rate["company"]["name"],
45
46
  carrier_logo_url: rate["company"]["picture"]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MeApi
4
- VERSION = "1.0.1"
4
+ VERSION = "1.1.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: me_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Todas Essas Coisas
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-09-11 00:00:00.000000000 Z
11
+ date: 2024-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ac