vinochipper 0.0.5 → 0.0.6

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
  SHA256:
3
- metadata.gz: d9f6e3aee32c3d1499541f559efa2f0849a5283fe6fc843fff8811414f3de84c
4
- data.tar.gz: d92922741a359b640495917f3df49c9a7e19d0ac16560db6c69c7f31c11410fe
3
+ metadata.gz: 40bdb34b35b611fd34addce52f0ca1c17c930f716d728ff33d07baf0ca9ee1ac
4
+ data.tar.gz: b68c0391fecd0ba2b01467f5da83e5f3ba64dd4f0744171e45df88607cbd1e83
5
5
  SHA512:
6
- metadata.gz: 9ce82daac3fa1c37732dac86969f5a4fe7db401ea68163daf76bc4f62fd920972054576463ee52ba90877643ab28ac7c556e1f8c8ab9777ea33e506574b53b0d
7
- data.tar.gz: 305890b61e9b4da7e826843df60b2b3d8a0ff28fc56167604683eafe900acd883fe28f433a6d00c1090a1f63abe7561b3119f6b616d48c8e5dce9cceb3ada88c
6
+ metadata.gz: 2f68fe3451c0a6c7e8c549efa8f382b1dfb7bbd3927413c35ec3d0038c6ec5e4657980afc53275abbbfcb1626f42f62c32f694eca2082c6a82fd1b2445d2746c
7
+ data.tar.gz: bb1d496172d21bcac487661d96a9fdd0d6b6b96429a4b3502e85ff8034d41e5ebc1b374c40d3df0e7030b7bf510720d0732a05195a57c7173a41e45fa6683529
@@ -2,6 +2,6 @@ require 'models/vinochippermodel'
2
2
 
3
3
  class VCState < VinoChipperModel
4
4
  def to_s
5
- self.state
5
+ state
6
6
  end
7
7
  end
@@ -7,18 +7,18 @@ class VCWineList < VinoChipperModel
7
7
  def initialize(deets)
8
8
  super
9
9
  self.winery = VCWinery.new(winery)
10
- self.wines = wines.map { |wine| (VCWine.new(wine))}
11
- self.ships_to = ships_to.map { |state| (VCState.new(state))}
10
+ self.wines = wines.map { |wine| VCWine.new(wine) }
11
+ self.ships_to = ships_to.map { |state| VCState.new(state) }
12
12
  end
13
13
 
14
14
  def to_s
15
15
  "Winery: #{winery}
16
16
 
17
- Wines: #{wines.map{|wine| wine.to_s}}
17
+ Wines: #{wines.map { |wine| wine & :to_s }}
18
18
 
19
19
  Promotions: #{promotions}
20
20
 
21
- Ships_to: #{ships_to.map{|state| state.to_s}}
21
+ Ships_to: #{ships_to.map { |state| state & :to_s }}
22
22
 
23
23
  Special_Shipping: #{special_shipping}"
24
24
  end
@@ -5,6 +5,10 @@ class VinoChipperModel
5
5
  @deets = deets
6
6
  end
7
7
 
8
+ def respond_to_missing?(method_name, _include_private = false)
9
+ @deets.keys.include? method_name.to_s
10
+ end
11
+
8
12
  def method_missing(*args)
9
13
  message = args[0].to_s.camel_case_lower
10
14
  if message.end_with?('=')
@@ -14,7 +18,7 @@ class VinoChipperModel
14
18
  end
15
19
  end
16
20
 
17
- def to_s
21
+ def keys
18
22
  @deets.keys
19
23
  end
20
24
  end
@@ -1,5 +1,5 @@
1
1
  class String
2
2
  def camel_case_lower
3
- self.split('_').inject([]){ |buffer,e| buffer.push(buffer.empty? ? e : e.capitalize) }.join
3
+ split('_').inject([]) { |buffer, e| buffer.push(buffer.empty? ? e : e.capitalize) }.join
4
4
  end
5
5
  end
@@ -3,14 +3,9 @@ require 'net/http'
3
3
 
4
4
  require 'models/vcwinelist'
5
5
 
6
- class Vinochipper
7
-
6
+ class VinoChipper
8
7
  BASE_URL = 'https://vinoshipper.com/json-api/v2/'.freeze
9
8
 
10
- def self.hi
11
- puts 'hello world'
12
- end
13
-
14
9
  def self.wine_list(id)
15
10
  response = Net::HTTP.get_response(URI.parse(BASE_URL + 'wine-list?id=' + id.to_s))
16
11
  VCWineList.new(JSON.parse(response.body))
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vinochipper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kent Slaymaker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-15 00:00:00.000000000 Z
11
+ date: 2020-08-27 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Interface for the VinoShipper API
14
14
  email: kent@slaymakercellars.com
@@ -33,9 +33,9 @@ require_paths:
33
33
  - lib
34
34
  required_ruby_version: !ruby/object:Gem::Requirement
35
35
  requirements:
36
- - - ">="
36
+ - - '='
37
37
  - !ruby/object:Gem::Version
38
- version: '0'
38
+ version: 2.7.1
39
39
  required_rubygems_version: !ruby/object:Gem::Requirement
40
40
  requirements:
41
41
  - - ">="