simple_schema 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -21,6 +21,8 @@ module SimpleSchema
21
21
  value = data.fetch(key, nil)
22
22
  elsif data.respond_to?(:read_attribute)
23
23
  value = data.read_attribute(key)
24
+ elsif data.respond_to?(key)
25
+ value = data.send(key)
24
26
  else
25
27
  raise InvalidDataType.new(data.class)
26
28
  end
@@ -43,6 +45,8 @@ module SimpleSchema
43
45
  value = data.fetch(key, nil)
44
46
  elsif data.respond_to?(:read_attribute)
45
47
  value = data.read_attribute(key)
48
+ elsif data.respond_to?(key)
49
+ value = data.send(key)
46
50
  else
47
51
  raise InvalidDataType.new(data.class)
48
52
  end
@@ -1,4 +1,4 @@
1
1
  module SimpleSchema
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
4
4
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_schema
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,11 +13,11 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2011-09-17 00:00:00.000000000Z
16
+ date: 2011-09-19 00:00:00.000000000Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: rspec
20
- requirement: &11643600 !ruby/object:Gem::Requirement
20
+ requirement: &19824420 !ruby/object:Gem::Requirement
21
21
  none: false
22
22
  requirements:
23
23
  - - ! '>='
@@ -25,7 +25,7 @@ dependencies:
25
25
  version: '0'
26
26
  type: :development
27
27
  prerelease: false
28
- version_requirements: *11643600
28
+ version_requirements: *19824420
29
29
  description: Simple schema validator for Ruby
30
30
  email:
31
31
  - lenon.marcel@gmail.com