next-big-sound-lite 0.1.4 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -6,7 +6,7 @@ Done? Then you can use this API.
6
6
 
7
7
  First setup the gem to use your API key:
8
8
 
9
- NBS::KEY = 'your_key'
9
+ NBS.api_key = 'your_key'
10
10
 
11
11
  The methods of this wrapper are organized in the same way as the subsections of the API docs. For example to call the resource 'view' on Artists you should call:
12
12
 
data/Rakefile CHANGED
@@ -3,7 +3,7 @@ require 'rubygems'
3
3
  require 'rake'
4
4
  require 'echoe'
5
5
 
6
- Echoe.new('next-big-sound-lite', '0.1.4') do |p|
6
+ Echoe.new('next-big-sound-lite', '0.1.6') do |p|
7
7
  p.description = "Thin wrapper for the Next Big Sound API."
8
8
  p.url = "http://github.com/rpbertp13/next-big-sound-lite"
9
9
  p.author = "Roberto Thais"
@@ -3,12 +3,21 @@ require 'json'
3
3
 
4
4
  #for version 2.0 of the NBS API
5
5
  module NBS
6
-
7
- BASE = RestClient::Resource.new("http://#{NBS.const_defined? :KEY ? KEY : 'key'}.api2.nextbigsound.com")
6
+
7
+
8
+ def self.api_key=(key)
9
+ @base = RestClient::Resource.new("http://#{key}.api2.nextbigsound.com")
10
+ end
11
+
12
+ def self.base
13
+ @base
14
+ end
15
+
16
+ self.api_key = 'key'
8
17
 
9
18
  class Artist
10
19
 
11
- @resource = BASE['artists']
20
+ @resource = NBS.base['artists']
12
21
 
13
22
  def self.view(id)
14
23
  res = @resource["view/#{id}.json"].get
@@ -30,7 +39,7 @@ module NBS
30
39
 
31
40
  class Genre
32
41
 
33
- @resource = BASE['genres']
42
+ @resource = NBS.base['genres']
34
43
 
35
44
  def self.artist(id)
36
45
  res = @resource["artist/#{id}.json"].get
@@ -40,7 +49,7 @@ module NBS
40
49
 
41
50
  class Metric
42
51
 
43
- @resource = BASE['metrics']
52
+ @resource = NBS.base['metrics']
44
53
 
45
54
  def self.profile(id)
46
55
  res = @resource["profile/#{id}.json"].get
@@ -55,7 +64,7 @@ module NBS
55
64
 
56
65
  class Profile
57
66
 
58
- @resource = BASE['profiles']
67
+ @resource = NBS.base['profiles']
59
68
 
60
69
  def self.artist(id)
61
70
  res = @resource["artist/#{id}.json"].get
@@ -70,7 +79,7 @@ module NBS
70
79
 
71
80
  class Service
72
81
 
73
- @resource = BASE['services']
82
+ @resource = NBS.base['services']
74
83
 
75
84
  def self.list
76
85
  JSON.parse(@resource['.json'].get)
@@ -80,7 +89,7 @@ module NBS
80
89
 
81
90
  class Track
82
91
 
83
- @resource = BASE['tracks']
92
+ @resource = NBS.base['tracks']
84
93
 
85
94
  def self.artist(id)
86
95
  res = @resource["artist/#{id}.json"].get
@@ -96,7 +105,7 @@ module NBS
96
105
 
97
106
  class Youtube
98
107
 
99
- @resource = BASE['youtube']
108
+ @resource = NBS.base['youtube']
100
109
 
101
110
  def self.artist(id)
102
111
  res = @resource["artist/#{id}.json"].get
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{next-big-sound-lite}
5
- s.version = "0.1.4"
5
+ s.version = "0.1.6"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Roberto Thais"]
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 4
9
- version: 0.1.4
8
+ - 6
9
+ version: 0.1.6
10
10
  platform: ruby
11
11
  authors:
12
12
  - Roberto Thais