rhapsody 0.0.9 → 0.0.10
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,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
!binary "U0hBMQ==":
|
|
3
3
|
metadata.gz: !binary |-
|
|
4
|
-
|
|
4
|
+
MjE0ZjM0NTk0M2M2ZWYwNjE5M2QyYTMwMjU1NGM3M2RmM2U2MDNhZQ==
|
|
5
5
|
data.tar.gz: !binary |-
|
|
6
|
-
|
|
6
|
+
ZTNmYWZjYzZjNWQ4OTVhZTcyOWE2NzQ2ZjEwY2QxZmM2ZDg3OWFjOA==
|
|
7
7
|
SHA512:
|
|
8
8
|
metadata.gz: !binary |-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
YzI4MzY2N2EyOWM1YTZmOGQ3OTE2YTQ3NjIyZDYxZWI5NjA1NjkxYjE4NDAw
|
|
10
|
+
YTI4MDkxNmZmMTI3NTA0ZjZhZjcyNzYyNzAzZmVkZTMyYWE1MmY0NDg5Y2E1
|
|
11
|
+
Y2QwYWI2N2E3ZGZlMzJkODNmYTM3MzU2M2I4NGM2Mjg4MzY4ZTA=
|
|
12
12
|
data.tar.gz: !binary |-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
Y2UwMmJkODRhN2U5YmY2MWVmMDcxNTJhMmMyYzM1ZjJlZDRjZjYzYjY0YWIx
|
|
14
|
+
ZTY3YWFlMzY3NjExMWQzM2Q1NzZlNGM4Njg0MzZjYThkNGJhNmUzYTA1YWRj
|
|
15
|
+
ZmNkZGNkNWQyN2M0N2M5MDU5MzZkODg1Y2E3NjZkY2U1OWNmOGQ=
|
|
@@ -1,46 +1,9 @@
|
|
|
1
1
|
class Rhapsody::Member
|
|
2
2
|
require 'json'
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
{attribute: :cobrand, type: 'String'},
|
|
6
|
-
{attribute: :cocat, type: 'String'},
|
|
7
|
-
{attribute: :email, type: 'String'},
|
|
8
|
-
{attribute: :logon, type: 'String'},
|
|
9
|
-
{attribute: :first_name, type: 'String'},
|
|
10
|
-
{attribute: :id, type: 'String'},
|
|
11
|
-
{attribute: :last_name, type: 'String'},
|
|
12
|
-
{attribute: :locale, type: 'String'},
|
|
13
|
-
{attribute: :country, type: 'String'},
|
|
14
|
-
{attribute: :is_public, type: 'Boolean'},
|
|
15
|
-
{attribute: :billing_partner_code, type: 'String'},
|
|
16
|
-
{attribute: :create_date, type: 'Integer'},
|
|
17
|
-
{attribute: :is_suspended, type: 'Boolean'},
|
|
18
|
-
{attribute: :tier_code, type: 'String'},
|
|
19
|
-
{attribute: :tier_name, type: 'String'},
|
|
20
|
-
{attribute: :product_code, type: 'String'},
|
|
21
|
-
{attribute: :product_name, type: 'String'},
|
|
22
|
-
{attribute: :expiration_date, type: 'Integer'},
|
|
23
|
-
{attribute: :trial_length_days, type: 'Integer'},
|
|
24
|
-
{attribute: :is_trial, type: 'Boolean'},
|
|
25
|
-
{attribute: :state, type: 'String'},
|
|
26
|
-
{attribute: :can_stream_on_web, type: 'Boolean'},
|
|
27
|
-
{attribute: :can_stream_on_mobile, type: 'Boolean'},
|
|
28
|
-
{attribute: :can_stream_on_home_device, type: 'Boolean'},
|
|
29
|
-
{attribute: :can_stream_on_pc, type: 'Boolean'},
|
|
30
|
-
{attribute: :can_upgrade_streams, type: 'Boolean'},
|
|
31
|
-
{attribute: :max_stream_count, type: 'Integer'},
|
|
32
|
-
{attribute: :is_play_based_tier, type: 'Boolean'},
|
|
33
|
-
{attribute: :is_monthly_play_based_tier, type: 'Boolean'},
|
|
34
|
-
{attribute: :is_one_time_play_based_tier, type: 'Boolean'},
|
|
35
|
-
{attribute: :total_plays, type: 'Integer'},
|
|
36
|
-
{attribute: :plays_remaining, type: 'Integer'}
|
|
37
|
-
]
|
|
4
|
+
attr_accessor :attr_list
|
|
38
5
|
|
|
39
6
|
class << self
|
|
40
|
-
def attr_list_hash_attr
|
|
41
|
-
ATTR_LIST_HASH.map {|hash| hash[:attribute] }
|
|
42
|
-
end
|
|
43
|
-
|
|
44
7
|
# TODO: This needs to be global / base
|
|
45
8
|
def define_attr_accessor(key)
|
|
46
9
|
__send__(:attr_accessor, key)
|
|
@@ -53,11 +16,14 @@ class Rhapsody::Member
|
|
|
53
16
|
|
|
54
17
|
def initialize(options)
|
|
55
18
|
if options
|
|
19
|
+
self.attr_list = []
|
|
20
|
+
|
|
56
21
|
options.each do |key, value|
|
|
57
22
|
key = Rhapsody::Member.to_camelcase(key)
|
|
58
23
|
|
|
59
24
|
# Set attr_accessor dynamically
|
|
60
25
|
Rhapsody::Member.define_attr_accessor(key)
|
|
26
|
+
self.attr_list << key
|
|
61
27
|
|
|
62
28
|
# Set value for the attribute
|
|
63
29
|
send("#{key}=", value)
|
data/lib/rhapsody/version.rb
CHANGED
|
@@ -67,6 +67,9 @@ describe Rhapsody::ClientsController do
|
|
|
67
67
|
member_attributes.each do |attr|
|
|
68
68
|
expect(member).to respond_to(attr.to_s.underscore)
|
|
69
69
|
end
|
|
70
|
+
|
|
71
|
+
expect(member).to respond_to(:attr_list)
|
|
72
|
+
expect(member.attr_list).to eql(member_attributes.map {|attr| attr.to_s.underscore })
|
|
70
73
|
end
|
|
71
74
|
|
|
72
75
|
it '#renew' do
|