chiketto 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/chiketto.rb +1 -0
- data/lib/chiketto/attendee.rb +14 -4
- data/lib/chiketto/attendee_profile.rb +18 -0
- data/lib/chiketto/version.rb +1 -1
- data/test/attendee_profile_test.rb +21 -0
- data/test/attendee_test.rb +16 -4
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92e0b61671c1bb652bf1cd694ae5847b832ad2c2
|
4
|
+
data.tar.gz: 7b7b121ca685c5c96d6d6a37c85f241ece0b1ada
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 65366f24528bc323e4d41823dfc3b0860b7bcf95d9c43e45d3c1b02f24707181e7e47a8eecdf5a779fe73d5c5c0217a10312d24e7d26dee591f07f47316c4c34
|
7
|
+
data.tar.gz: 503340e8ff16e01534245258fec086bdd6511d935083cb0b7d22225301df35324b212adb945de72a462c89ad3a66c840f53fb740326b1872091677db5ec06a8f
|
data/lib/chiketto.rb
CHANGED
data/lib/chiketto/attendee.rb
CHANGED
@@ -1,12 +1,22 @@
|
|
1
1
|
module Chiketto
|
2
2
|
class Attendee < Resource
|
3
|
-
attr_accessor :
|
4
|
-
:quantity,
|
3
|
+
attr_accessor :quantity,
|
5
4
|
:status,
|
6
|
-
:
|
7
|
-
:
|
5
|
+
:ticket_class_id,
|
6
|
+
:event_id,
|
7
|
+
:order_id
|
8
8
|
|
9
9
|
attr_date :changed,
|
10
10
|
:created
|
11
|
+
|
12
|
+
def profile
|
13
|
+
AttendeeProfile.new @profile.to_h
|
14
|
+
end
|
15
|
+
|
16
|
+
def addresses
|
17
|
+
@addresses.to_h.inject({}) do |hash, (key, address)|
|
18
|
+
hash.merge(key.to_sym => Address.new(address.to_h))
|
19
|
+
end
|
20
|
+
end
|
11
21
|
end
|
12
22
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Chiketto
|
2
|
+
class AttendeeProfile < Resource
|
3
|
+
attr_accessor :first_name,
|
4
|
+
:last_name,
|
5
|
+
:email,
|
6
|
+
:name,
|
7
|
+
:prefix,
|
8
|
+
:suffix,
|
9
|
+
:age,
|
10
|
+
:job_title,
|
11
|
+
:company,
|
12
|
+
:website,
|
13
|
+
:blog,
|
14
|
+
:gender,
|
15
|
+
:birth_date,
|
16
|
+
:cell_phone
|
17
|
+
end
|
18
|
+
end
|
data/lib/chiketto/version.rb
CHANGED
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class AttendeeProfileTest < MiniTest::Test
|
4
|
+
def test_exposes_data
|
5
|
+
attendee_profile = Chiketto::AttendeeProfile.new
|
6
|
+
assert_respond_to attendee_profile, :first_name
|
7
|
+
assert_respond_to attendee_profile, :last_name
|
8
|
+
assert_respond_to attendee_profile, :email
|
9
|
+
assert_respond_to attendee_profile, :name
|
10
|
+
assert_respond_to attendee_profile, :prefix
|
11
|
+
assert_respond_to attendee_profile, :suffix
|
12
|
+
assert_respond_to attendee_profile, :age
|
13
|
+
assert_respond_to attendee_profile, :job_title
|
14
|
+
assert_respond_to attendee_profile, :company
|
15
|
+
assert_respond_to attendee_profile, :website
|
16
|
+
assert_respond_to attendee_profile, :blog
|
17
|
+
assert_respond_to attendee_profile, :gender
|
18
|
+
assert_respond_to attendee_profile, :birth_date
|
19
|
+
assert_respond_to attendee_profile, :cell_phone
|
20
|
+
end
|
21
|
+
end
|
data/test/attendee_test.rb
CHANGED
@@ -3,12 +3,13 @@ require 'test_helper'
|
|
3
3
|
class AttendeeTest < MiniTest::Test
|
4
4
|
def test_exposes_data
|
5
5
|
attendee = Chiketto::Attendee.new
|
6
|
-
assert_respond_to attendee, :
|
7
|
-
assert_respond_to attendee, :email
|
6
|
+
assert_respond_to attendee, :ticket_class_id
|
8
7
|
assert_respond_to attendee, :quantity
|
9
8
|
assert_respond_to attendee, :status
|
10
|
-
assert_respond_to attendee, :
|
11
|
-
assert_respond_to attendee, :
|
9
|
+
assert_respond_to attendee, :profile
|
10
|
+
assert_respond_to attendee, :event_id
|
11
|
+
assert_respond_to attendee, :order_id
|
12
|
+
assert_respond_to attendee, :addresses
|
12
13
|
end
|
13
14
|
|
14
15
|
def test_attr_date_types
|
@@ -17,4 +18,15 @@ class AttendeeTest < MiniTest::Test
|
|
17
18
|
assert_kind_of DateTime, attendee.created
|
18
19
|
assert_kind_of DateTime, attendee.changed
|
19
20
|
end
|
21
|
+
|
22
|
+
def test_attendee_returns_profile
|
23
|
+
attendee = Chiketto::Attendee.new
|
24
|
+
assert_kind_of Chiketto::AttendeeProfile, attendee.profile
|
25
|
+
end
|
26
|
+
|
27
|
+
def test_addresses_returns_an_addresses_array
|
28
|
+
attendee = Chiketto::Attendee.new addresses: { home: {} }
|
29
|
+
assert_kind_of Hash, attendee.addresses
|
30
|
+
assert_kind_of Chiketto::Address, attendee.addresses.values.first
|
31
|
+
end
|
20
32
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chiketto
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Radford
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -111,6 +111,7 @@ files:
|
|
111
111
|
- lib/chiketto.rb
|
112
112
|
- lib/chiketto/address.rb
|
113
113
|
- lib/chiketto/attendee.rb
|
114
|
+
- lib/chiketto/attendee_profile.rb
|
114
115
|
- lib/chiketto/attr_attribute.rb
|
115
116
|
- lib/chiketto/attribute.rb
|
116
117
|
- lib/chiketto/category.rb
|
@@ -124,6 +125,7 @@ files:
|
|
124
125
|
- lib/chiketto/version.rb
|
125
126
|
- lib/hash_ext.rb
|
126
127
|
- test/address_test.rb
|
128
|
+
- test/attendee_profile_test.rb
|
127
129
|
- test/attendee_test.rb
|
128
130
|
- test/attribute_test.rb
|
129
131
|
- test/category_test.rb
|
@@ -161,6 +163,7 @@ specification_version: 4
|
|
161
163
|
summary: Chiketto is a ruby gem for interacting with the Eventbrite V3 API
|
162
164
|
test_files:
|
163
165
|
- test/address_test.rb
|
166
|
+
- test/attendee_profile_test.rb
|
164
167
|
- test/attendee_test.rb
|
165
168
|
- test/attribute_test.rb
|
166
169
|
- test/category_test.rb
|