ika 1.0.8 → 1.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ika/version.rb +1 -1
- data/lib/ika.rb +15 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1dab61ca98c6d97af927448afd52dcfaf5310bd
|
4
|
+
data.tar.gz: 3df6fffe9fdb0f0585032180d0ef8ccdde1daff8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 313887f19ab40584f035f4cfdcc27e70037b36cf84183d2f7cdef6d19aae4fed3a866930b24ae50d878c1c1da20b117c7457f5c83500d8f9fa41ba50ed4c2a4a
|
7
|
+
data.tar.gz: fdd26b3270ada82f0b167e8dfd838f692db45afc67bf2ab295277ec290cbcdd42fb75596265e6e736639bacc7d1b7bd628e9394b56fead02912ea65a05738647
|
data/lib/ika/version.rb
CHANGED
data/lib/ika.rb
CHANGED
@@ -10,7 +10,7 @@ module Ika
|
|
10
10
|
module ClassMethods
|
11
11
|
include ::CarrierWave::Base64Uploader
|
12
12
|
|
13
|
-
def
|
13
|
+
def ika_import(json_or_array, options = {})
|
14
14
|
if json_or_array.is_a?(Array)
|
15
15
|
objects = json_or_array
|
16
16
|
else
|
@@ -68,7 +68,11 @@ module Ika
|
|
68
68
|
end
|
69
69
|
end
|
70
70
|
|
71
|
-
def
|
71
|
+
def import(json_or_array, options = {})
|
72
|
+
ika_import(json_or_array, options)
|
73
|
+
end
|
74
|
+
|
75
|
+
def ika_export(options = {}, object = nil)
|
72
76
|
CarrierWave::Uploader::Base.json_with_raw_data = true
|
73
77
|
all_symbol = true
|
74
78
|
options[:include] ||= []
|
@@ -101,9 +105,13 @@ module Ika
|
|
101
105
|
CarrierWave::Uploader::Base.json_with_raw_data = false
|
102
106
|
JSON.generate(whole_obj_arr)
|
103
107
|
end
|
108
|
+
|
109
|
+
def export(options = {}, object = nil)
|
110
|
+
ika_export(options, object)
|
111
|
+
end
|
104
112
|
end
|
105
113
|
|
106
|
-
def
|
114
|
+
def ika_export(options = {}, object = nil)
|
107
115
|
CarrierWave::Uploader::Base.json_with_raw_data = true
|
108
116
|
objects ||= self
|
109
117
|
all_symbol = true
|
@@ -132,6 +140,10 @@ module Ika
|
|
132
140
|
CarrierWave::Uploader::Base.json_with_raw_data = false
|
133
141
|
JSON.generate(obj_hash)
|
134
142
|
end
|
143
|
+
|
144
|
+
def export(options = {}, object = nil)
|
145
|
+
ika_export(options, object)
|
146
|
+
end
|
135
147
|
end
|
136
148
|
|
137
149
|
ActiveRecord::Base.send(:include, Ika)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ika
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Makoto NAKAYA
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2016-01-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|