meetupevents 0.1.22 → 0.2
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 +4 -4
- data/lib/meetupevents/event.rb +5 -3
- data/lib/meetupevents/version.rb +1 -1
- data/spec/meetupevents_spec.rb +6 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 61835a14671f9e1e79c1c548d448973a9cc138e7
|
4
|
+
data.tar.gz: c50ee7dc408c15fdb6d642091b0879cc4e72d72a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1735a1a51de0e17e27a78082c1b4bea86778e0e99be9e38c18302a804d89bb72d15234f183a8ce85208f92874c07662d435a33dd912a5b41ea71cb9eb6c1df77
|
7
|
+
data.tar.gz: 8ea757e4528046b8255dd4f9cbc93d9a940f90f7edd69f7361a55a33af4978ada5255d6a42e49afc21c7bc3c911b28d426ca83205898597d04a0f15a56c13672
|
data/lib/meetupevents/event.rb
CHANGED
@@ -6,10 +6,10 @@ module Meetup
|
|
6
6
|
# Class to set up a Meetup Event
|
7
7
|
class Event
|
8
8
|
attr_reader :name, :status, :city, :venue,
|
9
|
-
:time, :location, :url, :topic
|
9
|
+
:time, :location, :url, :topic, :description
|
10
10
|
|
11
11
|
def initialize(name:, status:, city:, venue:, time:,
|
12
|
-
location:, url:, topic:)
|
12
|
+
location:, url:, topic:, description:)
|
13
13
|
@name = name
|
14
14
|
@status = status
|
15
15
|
@city = city
|
@@ -18,6 +18,7 @@ module Meetup
|
|
18
18
|
@location = location
|
19
19
|
@url = url
|
20
20
|
@topic = topic
|
21
|
+
@description = description
|
21
22
|
end
|
22
23
|
end
|
23
24
|
|
@@ -41,11 +42,12 @@ module Meetup
|
|
41
42
|
# g['category'] ? g['category']['short_name'] : 'None'
|
42
43
|
# end
|
43
44
|
|
44
|
-
def initialize(country:, city:, topic:)
|
45
|
+
def initialize(country:, city:, topic: 'none')
|
45
46
|
raw_events = MeetupApi.get_events_city(country, city, topic)
|
46
47
|
@events = raw_events.map do |g|
|
47
48
|
Meetup::Event.new(name: g['name'], status: g['status'],
|
48
49
|
city: city,
|
50
|
+
description: g['description'],
|
49
51
|
venue: g['venue'] ? g['venue']['name'] : '', # may nil
|
50
52
|
time: g['time'], location: get_event_location(g),
|
51
53
|
url: g['event_url'], topic: topic)
|
data/lib/meetupevents/version.rb
CHANGED
data/spec/meetupevents_spec.rb
CHANGED
@@ -30,6 +30,12 @@ describe 'MeetUp Api tests' do
|
|
30
30
|
@cities.length.must_be :>, 0
|
31
31
|
end
|
32
32
|
|
33
|
+
it 'should load the located events from a city' do
|
34
|
+
located_events = Meetup::LocatedEvents.new(city: 'Taipei',
|
35
|
+
country: 'TW',
|
36
|
+
topic: 'none')
|
37
|
+
located_events.events.length.must_be :>, 0
|
38
|
+
end
|
33
39
|
it 'should load the events from a city' do
|
34
40
|
c_location = Meetup::Location.new(@city['lat'], @city['lon'])
|
35
41
|
city_object = Meetup::City.new(name: @city['city'],
|