hdcore 0.0.11 → 0.0.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MWJhYTA4OTliOWJjOTU3MmM5NzhjNDFlMzUwYWQ2Mzk5OTg1YjI2ZA==
4
+ MTQ0MTYxMTFlMWZiOWM3NDc3Mzg0MWVhYTA2MGFmZTEwZTZlMjI4YQ==
5
5
  data.tar.gz: !binary |-
6
- MWM1Yzg4Y2NkYTZlMzZlNzUwNDk4MWJhMWJhMjEyM2QzMjgzMmI2Ng==
6
+ NGI0MDZhMzFiYmMxZDMxZDk4YmViYzhiMmY2OWYyMGM3ZjlkZmRkNg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MjIxZWE2YjMyNTg5ZDRiMjI3OGFlMTc1ZjhhZmE3YTg3NWYxMjE0NzM3YTNl
10
- NDM1NmI1YWU4ZjFhOWQ0NmM0ZmYzMmNkYWQ4ZDA1ZjBjYjBmMzg1MjY5YjQ5
11
- MzZmYjE4YmU0YjFkNGVmNWVhZGQ0NjgxYmY2OGRjZGYzOGY0MzQ=
9
+ N2M1ZmVkODBmMjhiOGUxODIzNzY4NWM5MDU2ZTEyNjhlYmIxZGYyNmU0NDBm
10
+ YWZmNWUwZmYyODEzMzFlYWQ5NjJhOWI3OTdlNmQxZTQ1Yzc5ZDZjMjNlYzE2
11
+ NzNjMmE4OWFkN2I5MDg4NzI0NjlhZGI5NzgwNWE5YWZlNzFkOGM=
12
12
  data.tar.gz: !binary |-
13
- OTY5MmIwYmRkNjU4YWMzMDAxNjgxYWQ2MDAyMTFlZmMyY2I5NjI3Mzc2ZDNh
14
- YWVjYWEwNDlkZTgxZDk0NmUzMmI5YzI5NmMxMWYwNTJlODIwYjcwZmNjZDI0
15
- NzQwYjMzN2UyMGE5ZTk0YjNiZjM5MWE4ZTBkNTBjZjc2ZGJjMDA=
13
+ ZGZhNjVmZDEyZDZmZjdmOGM3ZGY3NmIwNjMwYWEyMGViNThiNWE3NGEyOWZh
14
+ OTIzM2MxNzBhOWQ5MDRjYzQ0ZTA3MWVlNTEyNDhkYmVhNzBlYWFlYjZhOGUy
15
+ MWVmNmU2NmY5ZTc1YmQ4YTQ3ZDU5NDNiZTlhNjYyODI0ZTczZDM=
@@ -10,7 +10,8 @@ module Hdcore
10
10
  # @return [HTTParty::Response]
11
11
  def call(action, params = {})
12
12
  init()
13
- self.post("/#{action.gsub('.','/')}.json", :query => query_string(action, params))
13
+ post "/#{action.gsub('.','/')}.json",
14
+ :body => full_api_parameters(action, params)
14
15
  end
15
16
 
16
17
  private
@@ -46,7 +47,7 @@ module Hdcore
46
47
  # @param [String] action The full API action
47
48
  # @param [Hash] params The given action parameters
48
49
  # @return [Hash] Full set of parameters, including generated api parameters
49
- def query_string(action, params = {})
50
+ def full_api_parameters(action, params = {})
50
51
  params.merge generate_api_params(action, params)
51
52
  end
52
53
 
@@ -1,3 +1,3 @@
1
1
  module Hdcore
2
- VERSION = "0.0.11"
2
+ VERSION = "0.0.12"
3
3
  end
@@ -5,18 +5,18 @@ describe Hdcore::Request do
5
5
  describe '.call' do
6
6
  it 'initializes and sends POST request to API endpoint' do
7
7
  test_action = 'some.action'
8
- Hdcore::Request.stub(:query_string).and_return(params = {:some => 'params'})
8
+ Hdcore::Request.stub(:full_api_parameters).and_return(params = {:some => 'params'})
9
9
  Hdcore::Request.should_receive(:init)
10
- Hdcore::Request.should_receive(:post).with("/#{test_action.gsub('.','/')}.json", params)
10
+ Hdcore::Request.should_receive(:post).with("/#{test_action.gsub('.','/')}.json", :body => params)
11
11
  Hdcore::Request.call(test_action, {})
12
12
  end
13
13
  end
14
14
 
15
15
 
16
- describe '.query_string' do
16
+ describe '.full_api_parameters' do
17
17
  it 'returns parameters merged with generated api parameters' do
18
18
  Hdcore::Request.stub(:generate_api_params).and_return(api_params = {:some => 'api_params'})
19
- actual = Hdcore::Request.send(:query_string, 'some.action', params = {:some_other => 'params'})
19
+ actual = Hdcore::Request.send(:full_api_parameters, 'some.action', params = {:some_other => 'params'})
20
20
  actual.should == params.merge(api_params)
21
21
  end
22
22
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hdcore
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ethan Pemble