sheets_db 0.8.0 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7d2784033de71d261f7e29a9f819ee2c8b9ebe8d
4
- data.tar.gz: 4eebf8e4ab589e9a4b343c6f963c96df5148fbcd
3
+ metadata.gz: 3512aee623de503648264a2420bf8e9a74b17a60
4
+ data.tar.gz: bf6c2802a235557a6ba296e49f45b51452f3c704
5
5
  SHA512:
6
- metadata.gz: eb21d0eff2870d21c7e73acc0cbdd1a19364ceb205f688df194b14ac7a996698eb50b797bf5226194eebbd54e2bc0ac2d098de7f61f90bb2c849b75fc0c53003
7
- data.tar.gz: 0df6e44c0dc91bb6b55a3298eb11bb6d21bfe48fdedb69bfad9776a567a001fba237876ca6febc0921a69f07efce25bbd3997007199fbeb0360631017bfcf9a6
6
+ metadata.gz: 91a34dbe4f66c7139be11a29580d300f654cf698d7355787b9ebf9c7bf75dc83a0f83386f349babbbbafba5f3e70f461cfc6d2229469ce9eb7b830400aa3ecc5
7
+ data.tar.gz: 24b4ffe779c70624c0ba02dd122b46b1f518c8ac7dcc224eb3bc695790201f20087c22ee55cc99a01c7dc87bef01b98472617499f86873b011d7f8dd5deffa14
@@ -169,7 +169,7 @@ end
169
169
 
170
170
  The only required argument to the `attribute` class method is the name of the column itself. All other options are optional:
171
171
 
172
- `type`: The `attribute` method currently supports four types: `Integer`, `DateTime`, `Boolean` and the default `String`. Any other value given to the `type` option will be ignored and the default will be used. (Note that the `Boolean` type must be specified as a string or symbol (`type: :Boolean`) since there is no actual `Boolean` class in Ruby.)
172
+ `type`: The `attribute` method currently supports five types: `Integer`, `Float`, `DateTime`, `Boolean` and the default `String`. Any other value given to the `type` option will be ignored and the default will be used. (Note that the `Boolean` type must be specified as a string or symbol (`type: :Boolean`) since there is no actual `Boolean` class in Ruby.)
173
173
 
174
174
  `multiple`: This option defaults to false. If true, it tells SheetsDB to parse the value as a comma-separated list of values, and return an array by splitting on the comma (if no comma is found, it will return a single element array).
175
175
 
@@ -1,3 +1,3 @@
1
1
  module SheetsDB
2
- VERSION = "0.8.0"
2
+ VERSION = "0.8.1"
3
3
  end
@@ -7,7 +7,10 @@ module SheetsDB
7
7
  class << self
8
8
  def inherited(subclass)
9
9
  super
10
- subclass.instance_variable_set(:@attribute_definitions, @attribute_definitions)
10
+ subclass.instance_variable_set(
11
+ :@attribute_definitions,
12
+ Marshal.load(Marshal.dump(@attribute_definitions))
13
+ )
11
14
  end
12
15
 
13
16
  def attribute(name, type: String, multiple: false, transform: nil, column_name: nil, if_column_missing: nil)
@@ -167,6 +167,8 @@ module SheetsDB
167
167
  converted_value = case attribute_definition[:type].to_s
168
168
  when "Integer"
169
169
  raw_value.to_i
170
+ when "Float"
171
+ raw_value.to_f
170
172
  when "DateTime"
171
173
  DateTime.strptime(raw_value, "%m/%d/%Y %H:%M:%S")
172
174
  when "Boolean"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sheets_db
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ravi Gadad
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-03-30 00:00:00.000000000 Z
11
+ date: 2019-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google_drive