haveapi 0.4.0 → 0.4.1

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: 97a0780e86ee6d9273d743c2c6b7c87ba053b19d
4
- data.tar.gz: aa2f1bda2b113b1ea0452da5940dabc1617bf68e
3
+ metadata.gz: 3c5949089f07c15226d74339f06a2dc0c1f09fb8
4
+ data.tar.gz: 8b6f6e19b9c3b21ec1ea7ce9aaa47fb0bbeb6589
5
5
  SHA512:
6
- metadata.gz: f665c8857e439f36280aae5634f3ff98cce618d645f6b4104a6d00c7a82727bd787edffed0ca7ed2f3daf60646711105e2d408b58f2557b40e773916a665afac
7
- data.tar.gz: 29bcfa9af9295e10bde9ead47df70bca5d185ea79ea656660f80a26b4ed54cf3f35ea6e142b88f2f7ff6480f92080c4172d8e8986f912700bd6d57f0f1fcd34c
6
+ metadata.gz: a7e6f414ffd0950b1c5a0acad38dc8821054dcb9bd82a28cba1b2cd30712d21476a36467b36be0223ea17d3a0336469d8685332fecc4a36ceb87057b917b79e6
7
+ data.tar.gz: c088d335f5588f90a1c9cb3ea5ce7f7799f14981d4a4d8eb1a46adf707c6c51fbc07689ce36b7c88c567f5a5cd8fb441789bd01a01990c2e28e6a1f8538cf428
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ * Sat Jan 23 2016 - version 0.4.1
2
+ - Fix parameter label setting
3
+ - Don't change hash arguments given to parameters
4
+
1
5
  * Wed Jan 20 2016 - version 0.4.0
2
6
  - Introduced protocol version, currently 1.0
3
7
  - Renamed certain API configuration methods
@@ -5,18 +5,21 @@ module HaveAPI::Parameters
5
5
  attr_reader :name, :label, :desc, :type, :default
6
6
 
7
7
  def initialize(name, args = {})
8
+ # The hash values are deleted and it shouldn't affect the received hash
9
+ myargs = args.clone
10
+
8
11
  @name = name
9
- @label = args.delete(:label) || name.to_s.capitalize
12
+ @label = myargs.delete(:label) || name.to_s.capitalize
10
13
  @layout = :custom
11
14
 
12
- ATTRIBUTES.each do |attr|
13
- instance_variable_set("@#{attr}", args.delete(attr))
15
+ (ATTRIBUTES - %i(label)).each do |attr|
16
+ instance_variable_set("@#{attr}", myargs.delete(attr))
14
17
  end
15
18
 
16
19
  @type ||= String
17
20
 
18
- @validators = HaveAPI::ValidatorChain.new(args) unless args.empty?
19
- fail "unused arguments #{args}" unless args.empty?
21
+ @validators = HaveAPI::ValidatorChain.new(myargs) unless myargs.empty?
22
+ fail "unused arguments #{myargs}" unless myargs.empty?
20
23
  end
21
24
 
22
25
  def db_name
@@ -1,4 +1,4 @@
1
1
  module HaveAPI
2
2
  PROTOCOL_VERSION = '1.0'
3
- VERSION = '0.4.0'
3
+ VERSION = '0.4.1'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: haveapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jakub Skokan