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 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.4')
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 => ::Fixnum },
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
- (ATTRIBUTE_TYPES.has_key?(type.to_sym) ? ATTRIBUTE_TYPES[type.to_sym] : ATTRIBUTE_TYPES[:other])[:method]
22
+ get_attribute_type_config(type)[:method]
22
23
  end
23
24
 
24
25
  def attribute_type_to_kind(type)
25
- (ATTRIBUTE_TYPES.has_key?(type.to_sym) ? ATTRIBUTE_TYPES[type.to_sym] : ATTRIBUTE_TYPES[:other])[:kind]
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
@@ -3,7 +3,7 @@ module Resourceful
3
3
 
4
4
  MAJOR = 0
5
5
  MINOR = 7
6
- TINY = 25
6
+ TINY = 26
7
7
 
8
8
  def self.to_s # :nodoc:
9
9
  [MAJOR, MINOR, TINY].join('.')
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.25
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-11-24 00:00:00 -06:00
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.4
73
+ version: 0.2.5
74
74
  version:
75
75
  description:
76
76
  email: kelly@kelredd.com