chiketto 0.1.4 → 0.2.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
  SHA1:
3
- metadata.gz: 9c4a4e47646b64d0ff3eba1c00709695ad424aab
4
- data.tar.gz: 052086611ed2f221df741afc365b4b13783ec03e
3
+ metadata.gz: 131a170fb06a5ed5d165c9991303144803a26ea8
4
+ data.tar.gz: 493b872900bbdeaa3cdb543882d21d5aaae0506d
5
5
  SHA512:
6
- metadata.gz: 8b210dda01ca15b5bd9b478cb5b943fdcdbf6cae1be3e125c5feea38c2e286ebc6641306567e0371e9030641994d83d0f58045c898857dccd41663c899b6df4c
7
- data.tar.gz: b70b3db0799dfe7cd14a1c865ebc4f55b426de48d9f3b1f9f1ca9fe2c7bed088000d29f530a0bd997f0eb244c11fbc3bba8378c9c205afa13db75c498c7e47c1
6
+ metadata.gz: 22065b1be117ebaf4a42be8e96c00a64f23108ca8d5cdce71e0ae90f41a060f5946955d4413d5070562fbe864462f5f9a9f935c0c1d6be15dfbe7a1f8c9d3bee
7
+ data.tar.gz: 039b535a604e1f8f36e3bba78073adaeca13ca4160e025b4dc8732650580012adca92ccc917dfe4046dd54a336ed43eaf4f17b466d743748455e426ded6fb519
@@ -5,7 +5,9 @@ module Chiketto
5
5
  :region,
6
6
  :address_1,
7
7
  :address_2,
8
- :country_name
8
+ :country_name,
9
+ :longitude,
10
+ :latitude
9
11
 
10
12
  def to_s
11
13
  [@address_1, @address_2, @city, @region, @country].
@@ -1,11 +1,9 @@
1
1
  module Chiketto
2
2
  class Venue < Resource
3
- attr_accessor :latitude,
4
- :longitude,
5
- :name
3
+ attr_accessor :name
6
4
 
7
- def address
8
- Chiketto::Address.new @address.to_h
5
+ def location
6
+ Chiketto::Address.new @location.to_h
9
7
  end
10
8
 
11
9
  def to_s
@@ -1,3 +1,3 @@
1
1
  module Chiketto
2
- VERSION = "0.1.4"
2
+ VERSION = "0.2.0"
3
3
  end
data/test/address_test.rb CHANGED
@@ -7,7 +7,9 @@ class AddressTest < MiniTest::Test
7
7
  'region' => 'CA',
8
8
  'address_1' => '651 Brannan',
9
9
  'address_2' => 'Suite 110',
10
- 'country_name' => 'United States'
10
+ 'country_name' => 'United States',
11
+ 'latitude' => '42.3618641',
12
+ 'longitude' => '-71.0905626'
11
13
  end
12
14
 
13
15
  def test_responds_to_methods
@@ -17,6 +19,8 @@ class AddressTest < MiniTest::Test
17
19
  assert_respond_to @address, :address_1
18
20
  assert_respond_to @address, :address_2
19
21
  assert_respond_to @address, :country_name
22
+ assert_respond_to @address, :longitude
23
+ assert_respond_to @address, :latitude
20
24
  end
21
25
 
22
26
  def test_responds_to_string_method
data/test/venue_test.rb CHANGED
@@ -3,35 +3,33 @@ require 'test_helper'
3
3
  class VenueTest < MiniTest::Test
4
4
  def basic_venue
5
5
  @venue = Chiketto::Venue.new 'id' => '545454',
6
- 'latitude' => '42.3618641',
7
- 'longitude' => '-71.0905626',
8
6
  'name' => 'Eventbrite HQ'
9
7
  end
10
8
 
11
9
  def test_venue_methods_exist
12
10
  @venue = Chiketto::Venue.new 'id' => '545454',
13
- 'address' => {
11
+ 'location' => {
14
12
  'city' => 'San Francisco',
15
13
  'country' => 'US',
16
14
  'region' => 'CA',
17
15
  'address_1' => '651 Brannan',
18
16
  'address_2' => 'Suite 110',
19
- 'country_name' => 'United States'
17
+ 'country_name' => 'United States',
18
+ 'latitude' => '42.3618641',
19
+ 'longitude' => '-71.0905626',
20
20
  },
21
- 'latitude' => '42.3618641',
22
- 'longitude' => '-71.0905626',
23
21
  'name' => 'Eventbrite HQ'
24
22
 
25
23
  assert_respond_to @venue, :id
26
- assert_respond_to @venue, :address
27
- assert_respond_to @venue, :latitude
28
- assert_respond_to @venue, :longitude
24
+ assert_respond_to @venue, :location
29
25
  assert_respond_to @venue, :name
30
26
  end
31
27
 
32
28
  def test_venue_with_no_address
33
29
  basic_venue
34
- assert_respond_to @venue.address, :to_s
30
+ assert_respond_to @venue.location, :to_s
31
+ assert_respond_to @venue.location, :latitude
32
+ assert_respond_to @venue.location, :longitude
35
33
  end
36
34
 
37
35
  def test_venue_returns_name_for_to_s
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chiketto
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Radford