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
- ZWU1YzAyZDA5NDAzOTlmMmVkNzEzMGYxZWNmZjZmMTE1ZmU2ZWRmMg==
4
+ MjE0ZjM0NTk0M2M2ZWYwNjE5M2QyYTMwMjU1NGM3M2RmM2U2MDNhZQ==
5
5
  data.tar.gz: !binary |-
6
- M2JkNDUxOTJjYWQ4MGNmZjg2YjgyOTczMTY2YTZkYjJjYjgyYjQ5OQ==
6
+ ZTNmYWZjYzZjNWQ4OTVhZTcyOWE2NzQ2ZjEwY2QxZmM2ZDg3OWFjOA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- Y2ZmNGE4MmQzYTcxMTYwYTg0ZmI1YWRlMTQ1ZTM0NmQxNDg0MjVlYWQxNmU4
10
- NDQ4ZTc0MDBjOGRmZDI1NTQ3ZjNlZWUxY2M3ZDViM2RjNzY5MjdiOWJmMGQw
11
- MDhhOWFiMTBmMDE1ZDY5N2I0ZGZlMmYyMGVmNDZjZWNkNmI1ODA=
9
+ YzI4MzY2N2EyOWM1YTZmOGQ3OTE2YTQ3NjIyZDYxZWI5NjA1NjkxYjE4NDAw
10
+ YTI4MDkxNmZmMTI3NTA0ZjZhZjcyNzYyNzAzZmVkZTMyYWE1MmY0NDg5Y2E1
11
+ Y2QwYWI2N2E3ZGZlMzJkODNmYTM3MzU2M2I4NGM2Mjg4MzY4ZTA=
12
12
  data.tar.gz: !binary |-
13
- ZmNiNjc4NGM4ZGQwYmMxZGNhYzI5YzlmYzUyMDBmM2VmMzJhYjI3YWFkZTc4
14
- OWIyNDljYWIyZTRiYjIxODRhOTBiZTE5NGE1MmE0Mjk0YzQ1NWYzYjA1YjQz
15
- NzBiNmY2NWRkZmMzZmU2MDkzM2NlMGRjNmJlZGU3NTlhZDQ3Y2Q=
13
+ Y2UwMmJkODRhN2U5YmY2MWVmMDcxNTJhMmMyYzM1ZjJlZDRjZjYzYjY0YWIx
14
+ ZTY3YWFlMzY3NjExMWQzM2Q1NzZlNGM4Njg0MzZjYThkNGJhNmUzYTA1YWRj
15
+ ZmNkZGNkNWQyN2M0N2M5MDU5MzZkODg1Y2E3NjZkY2U1OWNmOGQ=
@@ -1,46 +1,9 @@
1
1
  class Rhapsody::Member
2
2
  require 'json'
3
3
 
4
- ATTR_LIST_HASH = [
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)
@@ -1,3 +1,3 @@
1
1
  module Rhapsody
2
- VERSION = "0.0.9"
2
+ VERSION = "0.0.10"
3
3
  end
@@ -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
@@ -13,7 +13,7 @@ describe Rhapsody do
13
13
  end
14
14
 
15
15
  it 'checks version' do
16
- expect(Rhapsody::VERSION).to eql('0.0.9')
16
+ expect(Rhapsody::VERSION).to eql('0.0.10')
17
17
  end
18
18
 
19
19
  it 'has a helper for getting an access token' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rhapsody
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Kim