kelredd-resourceful 0.7.25 → 0.7.26
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/lib/resourceful/model/attribute_types.rb +10 -3
- data/lib/resourceful/version.rb +1 -1
- metadata +3 -3
data/Rakefile
CHANGED
@@ -24,7 +24,7 @@ spec = Gem::Specification.new do |s|
|
|
24
24
|
s.add_dependency('rest-client')
|
25
25
|
s.add_dependency('mechanize')
|
26
26
|
s.add_dependency('log4r')
|
27
|
-
s.add_dependency('kelredd-useful', '>= 0.2.
|
27
|
+
s.add_dependency('kelredd-useful', '>= 0.2.5')
|
28
28
|
end
|
29
29
|
|
30
30
|
Rake::GemPackageTask.new(spec) do |pkg|
|
@@ -8,21 +8,28 @@ module Resourceful::Model::AttributeTypes
|
|
8
8
|
ATTRIBUTE_TYPES = {
|
9
9
|
:string => { :method => 'to_s', :kind => ::String },
|
10
10
|
:text => { :method => 'to_s', :kind => ::String },
|
11
|
-
:integer => { :method => 'to_i', :kind => ::
|
11
|
+
:integer => { :method => 'to_i', :kind => ::Integer },
|
12
12
|
:float => { :method => 'to_f', :kind => ::Float },
|
13
13
|
:currency => { :method => 'from_currency_to_f', :kind => ::Float },
|
14
14
|
:date => { :method => 'to_date', :kind => ::Date },
|
15
15
|
:datetime => { :method => 'to_datetime', :kind => ::DateTime },
|
16
|
+
:time => { :method => 'to_time_at', :kind => ::Time },
|
16
17
|
:boolean => { :method => 'to_boolean', :kind => ::Object },
|
17
18
|
:other => { :method => 'to_s', :kind => ::String }
|
18
19
|
}
|
19
20
|
|
20
21
|
def attribute_type_to_method(type)
|
21
|
-
(
|
22
|
+
get_attribute_type_config(type)[:method]
|
22
23
|
end
|
23
24
|
|
24
25
|
def attribute_type_to_kind(type)
|
25
|
-
(
|
26
|
+
get_attribute_type_config(type)[:kind]
|
27
|
+
end
|
28
|
+
|
29
|
+
private
|
30
|
+
|
31
|
+
def get_attribute_type_config(type)
|
32
|
+
ATTRIBUTE_TYPES.has_key?(type.to_sym) ? ATTRIBUTE_TYPES[type.to_sym] : ATTRIBUTE_TYPES[:other]
|
26
33
|
end
|
27
34
|
|
28
35
|
end
|
data/lib/resourceful/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kelredd-resourceful
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.26
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kelly Redding
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-12-06 00:00:00 -06:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -70,7 +70,7 @@ dependencies:
|
|
70
70
|
requirements:
|
71
71
|
- - ">="
|
72
72
|
- !ruby/object:Gem::Version
|
73
|
-
version: 0.2.
|
73
|
+
version: 0.2.5
|
74
74
|
version:
|
75
75
|
description:
|
76
76
|
email: kelly@kelredd.com
|