sparrow-entity 0.1.3 → 0.1.4

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
  SHA256:
3
- metadata.gz: 69113e86b45a13eb5d19a0943cb23cf4e3c8d3851335570d1712de019a316b7f
4
- data.tar.gz: 24556d2a767791e72ac5d22521e3fd2b1bede695ee9eb317b66f356b0dab673e
3
+ metadata.gz: beb7d32b5994be1e192e1fc9c926083f689e2f33e06d8d1442e8515bb2acf2bd
4
+ data.tar.gz: c3def87e14848442a4623b2c51efa26db39cbea941cea78088ae37a7391922bf
5
5
  SHA512:
6
- metadata.gz: 9bf271a192c53689eee128a566a2fa0b212b45830893fe8e41c27460bba8a12ad7c1dc3538bdde1afb536e77df5d34d9eca4820a354cba7dbf81c33012e42edb
7
- data.tar.gz: cf9accc428f958c6eba624ff8199d14d7df63e696c78f13bbe200d3d7818f4e6bec634ed459b4a30c48ef8418d4e20bea25be883a76921d690c458c982b3abdd
6
+ metadata.gz: e2372baf98b1142bb765f54d8dcd4e38848deb64914e2673357040a4c2f8e1a17be00bbf93a8e0a846bf3acde80c184e34b05b73e0e039d0aa227e3ea7f5c36f
7
+ data.tar.gz: 023ba12cbee19301e366480ad2748a5eff648030ccf7f4b9ed23e2aaa0582da1b6b30e1a7dd98d9a8dba8bafc94dc3e520fde0e030707d5e7b54c92abf279595
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sparrow-entity (0.1.3)
4
+ sparrow-entity (0.1.4)
5
5
  activemodel
6
6
  activemodel_object_info (~> 0.2.0)
7
7
  activesupport
@@ -69,6 +69,7 @@ module Sparrow
69
69
  def __class_body__
70
70
  results = __class_content__
71
71
  class_path.reverse.each { |sub| results = __module_content__(sub, results) } if class_path.present?
72
+ results << "\n"
72
73
  results
73
74
  end
74
75
 
@@ -80,6 +80,8 @@ module Sparrow
80
80
  val = value
81
81
  when ::String
82
82
  val = attr_class.parse(value)
83
+ val = val.localtime if attr_class.is_a?(::Time)
84
+ val = val.localtime.to_datetime if attr_class.is_a?(::DateTime)
83
85
  end
84
86
  instance_variable_set(instance_var_name, val)
85
87
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Sparrow
4
4
  # 当前版本号
5
- VERSION = '0.1.3'
5
+ VERSION = '0.1.4'
6
6
  # 当前综述
7
7
  SUMMARY = 'Provide an easy approach to build entity object for data that can not be reflected to database tables.'
8
8
  # 当前详述
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sparrow-entity
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - shiner