songdrop 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c43caf721fafd77cee6ef6c7b65c03204eef25a0
4
- data.tar.gz: 7b21184eb52411c51dbcea7ee03e55eb97d11492
3
+ metadata.gz: e9b48a38939efcce74f8b435291db6842e061cc8
4
+ data.tar.gz: 87b9897d37769ee9c13323f81420a6e329cbcdaa
5
5
  SHA512:
6
- metadata.gz: c83f183370b994bb2939e72e12221b0f921c726602c81d3f760382924f4814333e3c90968f05629fdb128cc78358abe8fc6f8ec5e0ccd9903c4afbf8d7f84000
7
- data.tar.gz: 268b15f34f6c3a46fd62b7ccbd128b0946e2fc1be59465d32ad09d589a97f5aac820dd9c6e0bba1fc6b7d0b40825a9c68f3e5d52375ec7f0bb8e629eae7659cd
6
+ metadata.gz: 34bdfc40f9ef92ff0f1d8fb6218d5229da5467ffe16dc0e75e9f9e28e11de4f8e8b3f2d562b93fe9ed0553bf5a0d3d6980d8fe4a66deac33ddecf19550ccded5
7
+ data.tar.gz: 0dd1b1e35f3ccd57bc347a777dd7a8e5bc226a137d1c49b46b6c0a4f06b384e0638098f2cea104d42c3e0b1e578a9c352bda9c2a60791b36c81fe8d882394ae8
@@ -15,5 +15,9 @@ module Songdrop
15
15
  result
16
16
  end
17
17
 
18
+ def errors?
19
+ !self.errors.nil?
20
+ end
21
+
18
22
  end
19
23
  end
@@ -1,4 +1,12 @@
1
1
  module Songdrop
2
2
  class Error < Base
3
3
  end
4
+
5
+ class Errors < Base
6
+
7
+ def on(attribute)
8
+ self.attributes[attribute.to_s]
9
+ end
10
+
11
+ end
4
12
  end
@@ -43,14 +43,14 @@ module Songdrop
43
43
 
44
44
  hash.keys.each do |property|
45
45
  # puts "[Songdrop::Parser] #{property} is a #{property.class}"
46
- if hash[property].is_a? Array
46
+ if hash[property].is_a?(Array)
47
47
  # puts "[Songdrop::Parser] parsing array #{property}"
48
48
  objects = []
49
49
  hash[property].each do |el|
50
50
  objects << objectize(el['object'], parse_object(el))
51
51
  end
52
52
  properties[property.to_sym] = objects
53
- elsif hash[property].is_a? Hash
53
+ elsif hash[property].is_a?(Hash) and hash[property]['object']
54
54
  # puts "[Songdrop::Parser] parsing hash #{property} of type #{hash[property]['object']}"
55
55
  object = objectize(hash[property]['object'], parse_object(hash[property]))
56
56
  properties[property.to_sym] = object
@@ -70,6 +70,7 @@ module Songdrop
70
70
  when :mix then Mix.new(properties)
71
71
  when :artist then Artist.new(properties)
72
72
  when :error then Error.new(properties)
73
+ when :errors then Errors.new(properties)
73
74
  else "[Songdrop::Parser] Don't know how to objectize #{type}"
74
75
  end
75
76
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: songdrop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Taylor
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-18 00:00:00.000000000 Z
11
+ date: 2013-07-21 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: songdrop is a Ruby & RubyMotion client for the Songdrop.com API.
14
14
  email: moomerman@gmail.com