freesound_ruby 0.1.0 → 0.1.1

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: c7c330090c9136df4e109206164576ffd359f6cc
4
- data.tar.gz: 937d092aa4adf2e3c0f7acbba0fad50bc835c4b0
3
+ metadata.gz: 7e48a9bb294fc73104a0fd5187168e0a0b200c6e
4
+ data.tar.gz: 8be2c865036aae3e5c89f3ff48a379558910da58
5
5
  SHA512:
6
- metadata.gz: a11224e534629891ab316b28a1e51f731fb9d3a1475fbb2645d264bd226b7f2b0d33bcd0fcc9e9681408a537aba96ca1101a414c352d28df2fd67dee0130ea97
7
- data.tar.gz: 695e4678310c54541367837d5050a858c1ad51af4580469ca09380eb6b79a9f1fd59298875fbc812fb898439a49d35940ab876b83d78f42353d56b49e23f5711
6
+ metadata.gz: 4b3077e7781c0ab4bd53966e7fa17dd85e4bf59df6bca640611cd639cdcf486b7edbcb22aaf1f090b39cc7cfeb544e055e07ecf76931e6d4a516f4249caaf14f
7
+ data.tar.gz: eb1f0d7763a28f6fcfac54c3c5db65def2bb5bfe1525f107ae327799ea86455c3d640a67ba49c6b609bef1343df2866a6fb85d93ec660d509f80185fffd504d6
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- freesound_ruby (0.1.0)
4
+ freesound_ruby (0.1.1)
5
5
  activeresource (~> 4.0.0)
6
6
 
7
7
  GEM
@@ -59,6 +59,18 @@ module Freesound
59
59
  end
60
60
  end
61
61
 
62
+ # Certain resource attributes contain dashes rather than underscores.
63
+ # This override allows resources with attributes like "preview-hq-mp3" to
64
+ # respond to "preview_hq_mp3" instead.
65
+ #
66
+ def initialize(attributes={}, *args)
67
+ underscored = attributes.inject({}) do |acc, (attr, value)|
68
+ acc.merge(attr.to_s.underscore => value)
69
+ end
70
+
71
+ super(underscored, *args)
72
+ end
73
+
62
74
  private
63
75
 
64
76
  def query_params(additional={})
@@ -1,3 +1,3 @@
1
1
  module Freesound
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -16,6 +16,10 @@ describe "finding a sound" do
16
16
  expect(sound.tags).to respond_to(:to_ary)
17
17
  end
18
18
 
19
+ it "transforms dashified attributes to underscores" do
20
+ expect(sound.preview_hq_mp3).to respond_to(:to_str)
21
+ end
22
+
19
23
  it "belongs to a user" do
20
24
  expect(sound.user.username).to be_present
21
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: freesound_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Genco