memphis 0.0.3 → 0.0.4

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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5c400a557a55c0e4d8f801d91f73c70c5572701c
4
- data.tar.gz: f710cee478c4520d23fdbd8797998e99192fa6f0
3
+ metadata.gz: 1334d1c816707816d461d6214ba5eef61b24c3ff
4
+ data.tar.gz: 7c28d8fe5a9401119454975e1cfaa0fa824cb1c0
5
5
  SHA512:
6
- metadata.gz: 437314343c81bf2e6d32ebeb06af7b99dd72d97c77a683cf1748aeefa017d4d0d1c8f1d68ddb3ed5c5be5e7e4ebe0b3d48dc2b549c38af1e41d7b63c32101334
7
- data.tar.gz: 46a236c0be1eba80c67205b3437e1f69628473758a2df2d59cb332abe868e8477690e5874cf5a5d0707a3f75e7650bdd3823fc862a3625f354553c12eba4b444
6
+ metadata.gz: f31fd08d8a6d6d77bac86a1b896c41199b2366f9f46070ca0da74eeedbb364e02d55c2dedb8c5e14e07625f4148f8e6f87980fd6e18fa9d5c092470b63b4b73f
7
+ data.tar.gz: 5e787ecb1ba5f7f3dfb5c135599ea94ab4252d9a744405ea139c793ac8d8945078af7424c6c23cc382bd81542b7dfdeca9dd63b5f08b6ad27eac7c84e416e234
data/README.md CHANGED
@@ -23,26 +23,33 @@ Or install it yourself as:
23
23
  ```ruby
24
24
  require 'memphis'
25
25
 
26
- memphis = Memphis::Client.new ECHONEST_API_KEY
26
+ memphis = Memphis::Memphis.new ECHONEST_API_KEY
27
27
 
28
28
  # Search using The Echo Nest ID for Radiohead
29
- results = memphis.search "ARH6W4X1187B99274F"
29
+ search_result = memphis.search "ARH6W4X1187B99274F"
30
+
31
+ # Show providers includeding in results
32
+
33
+ search_result.providers
34
+ => ["7digital", "deezer", "echonest", "facebook", "jambase", "musicbrainz", "playme", "rdio", "rhapsody", "seat_geek", "song_meanings", "songkick", "spotify", "twitter", "who_sampled"]
35
+
36
+ # Show results
30
37
 
31
- results["7digital"] # "304"
32
- results["deezer"] # "399"
33
- results["echonest"] # "Radiohead"
34
- results["facebook"] # "6979332244"
35
- results["jambase"] # "8317"
36
- results["musicbrainz"] # "a74b1b7f-71a5-4011-9441-d0b5e4122711"
37
- results["playme"] # "1307"
38
- results["rhapsody"] # "Art.4817"
39
- results["rdio"] # "r91318"
40
- results["seat_geek"] # "2570"
41
- results["songkick"] # "253846"
42
- results["song_meanings"] # "200"
43
- results["spotify"] # "4Z8W4fKeB5YxbusRsdQVPb"
44
- results["twitter"] # "radiohead"
45
- results["who_sampled"] # "3309"
38
+ search_result.7digital # "304"
39
+ search_result.deezer # "399"
40
+ search_result.echonest # "Radiohead"
41
+ search_result.facebook # "6979332244"
42
+ search_result.jambase # "8317"
43
+ search_result.musicbrainz # "a74b1b7f-71a5-4011-9441-d0b5e4122711"
44
+ search_result.playme # "1307"
45
+ search_result.rhapsody # "Art.4817"
46
+ search_result.rdio # "r91318"
47
+ search_result.seat_geek # "2570"
48
+ search_result.songkick # "253846"
49
+ search_result.song_meanings # "200"
50
+ search_result.spotify # "4Z8W4fKeB5YxbusRsdQVPb"
51
+ search_result.twitter # "radiohead"
52
+ search_result.who_sampled # "3309"
46
53
  ```
47
54
 
48
55
  ## Contributing
@@ -38,9 +38,11 @@ module Memphis
38
38
  end
39
39
 
40
40
  @id = id
41
- results = get_foreign_id_hash
41
+ results_hash = get_foreign_id_hash
42
42
 
43
- results
43
+ result = Result.new(results_hash)
44
+
45
+ result
44
46
  end
45
47
 
46
48
  private
@@ -0,0 +1,14 @@
1
+ module Memphis
2
+ class Memphis
3
+ attr_accessor :result
4
+
5
+ def initialize api_key=nil
6
+ @client = Client.new api_key
7
+ end
8
+
9
+ def search id
10
+ @result = @client.search id
11
+ end
12
+
13
+ end
14
+ end
@@ -0,0 +1,16 @@
1
+ module Memphis
2
+ class Result
3
+
4
+ attr_reader :providers
5
+
6
+ def initialize(hash)
7
+ @providers = []
8
+
9
+ hash.each do |key,value|
10
+ define_singleton_method(key.to_s){ hash[key] }
11
+ @providers.push key
12
+ @providers.sort!
13
+ end
14
+ end
15
+ end
16
+ end
@@ -1,3 +1,3 @@
1
1
  module Memphis
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
data/lib/memphis.rb CHANGED
@@ -1,4 +1,6 @@
1
+ require_relative 'memphis/memphis'
1
2
  require_relative 'memphis/client'
3
+ require_relative 'memphis/result'
2
4
  require_relative 'memphis/version'
3
5
 
4
6
  require 'httparty'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: memphis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Messick
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-27 00:00:00.000000000 Z
11
+ date: 2013-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -125,6 +125,8 @@ files:
125
125
  - Rakefile
126
126
  - lib/memphis.rb
127
127
  - lib/memphis/client.rb
128
+ - lib/memphis/memphis.rb
129
+ - lib/memphis/result.rb
128
130
  - lib/memphis/version.rb
129
131
  - memphis.gemspec
130
132
  - spec/client_spec.rb