rails_param 0.0.2 → 0.0.3

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: 49836118ba306758e4157e7466e8ec67d79222b9
4
- data.tar.gz: 48dde691b94c3e089b74e7f8d7279414b53ecf25
3
+ metadata.gz: 62719118e57a8eed3bd8b7cc8ff2f095d8e4dc73
4
+ data.tar.gz: da4a112bbd5252ef8c204c56c474764f7c55f7f7
5
5
  SHA512:
6
- metadata.gz: d92e097419c2abd3f19c000c39485ec59aba60f214b6266ea25d9f2241aa091250f1e11e4b64cbf8621c621f2c038909e9b7826f162fee1306a4aa6a5683e6d1
7
- data.tar.gz: 20a00f69034b111898d91ba86da224e01637bdc13b6ce1a89e316f8bbfcd5364dfbc8238dfbf111c85c191857285fb58d3787c190defa939ab0cb10a741728ee
6
+ metadata.gz: 25b3186f4eddf85cc8a7a0b7e3c0d7b1622e6f5109aeb83ed6480f517a07ef9ad97938ef166e3a92b3b1d1c8935a047518141bf5780cc913010fcf0707c15e69
7
+ data.tar.gz: faaeb8f5bc57ae2a25493d171901f516c934713b7b0748ad07b093459db444bc4641884d45322cc34b874d45c791caa7b136a301b4608dd4f334a45f2d0d8127
data/README.md CHANGED
@@ -40,9 +40,9 @@ By declaring parameter types, incoming parameters will automatically be transfor
40
40
  - `String`
41
41
  - `Integer`
42
42
  - `Float`
43
- - `Boolean` _("1/0", "true/false", "t/f", "yes/no", "y/n")_
43
+ - `:boolean/TrueClass/FalseClass` _("1/0", "true/false", "t/f", "yes/no", "y/n")_
44
44
  - `Array` _("1,2,3,4,5")_
45
- - `Hash` _(key1:value1,key2:value2)_
45
+ - `Hash` _("key1:value1,key2:value2")_
46
46
  - `Date`, `Time`, & `DateTime`
47
47
 
48
48
  ### Validations
@@ -53,7 +53,7 @@ module RailsParam
53
53
  return DateTime.parse(param) if type == DateTime
54
54
  return Array(param.split(options[:delimiter] || ",")) if type == Array
55
55
  return Hash[param.split(options[:delimiter] || ",").map{|c| c.split(options[:separator] || ":")}] if type == Hash
56
- return (/(false|f|no|n|0)$/i === param.to_s ? false : (/(true|t|yes|y|1)$/i === param.to_s ? true : nil)) if type == TrueClass || type == FalseClass || type == Boolean
56
+ return (/(false|f|no|n|0)$/i === param.to_s ? false : (/(true|t|yes|y|1)$/i === param.to_s ? true : nil)) if type == TrueClass || type == FalseClass || type == :boolean
57
57
  return nil
58
58
  rescue ArgumentError
59
59
  raise InvalidParameterError, "'#{param}' is not a valid #{type}"
@@ -1,3 +1,3 @@
1
1
  module RailsParam #:nodoc
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_param
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicolas Blanco
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-06 00:00:00.000000000 Z
11
+ date: 2014-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec