ika 1.0.8 → 1.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ika/version.rb +1 -1
  3. data/lib/ika.rb +15 -3
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 78361a6594b46092f33de8cc12eb2629b80a3f15
4
- data.tar.gz: 84b13e5b84806fb6a331015eade853a7b3e3c9ab
3
+ metadata.gz: c1dab61ca98c6d97af927448afd52dcfaf5310bd
4
+ data.tar.gz: 3df6fffe9fdb0f0585032180d0ef8ccdde1daff8
5
5
  SHA512:
6
- metadata.gz: 89d9a0138f2d77dbbea23ca0f415d2c1fdd425aa1cf341c14b07c8ea36ff0bc740f008701d91d3d2453cf149aff6f0bf5163cf82b11c2b7a1ed330bc857f12b4
7
- data.tar.gz: 2718bd5ef386bfd39c884ec24cfc164dae5a9692ce1e7f63f48fbb5799496a582c9fb76c8ded41a225b6f264daec7222d3e08e71079df4dc9e8cc007ee3093fb
6
+ metadata.gz: 313887f19ab40584f035f4cfdcc27e70037b36cf84183d2f7cdef6d19aae4fed3a866930b24ae50d878c1c1da20b117c7457f5c83500d8f9fa41ba50ed4c2a4a
7
+ data.tar.gz: fdd26b3270ada82f0b167e8dfd838f692db45afc67bf2ab295277ec290cbcdd42fb75596265e6e736639bacc7d1b7bd628e9394b56fead02912ea65a05738647
data/lib/ika/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ika
2
- VERSION = '1.0.8'
2
+ VERSION = '1.0.9'
3
3
  end
data/lib/ika.rb CHANGED
@@ -10,7 +10,7 @@ module Ika
10
10
  module ClassMethods
11
11
  include ::CarrierWave::Base64Uploader
12
12
 
13
- def import(json_or_array, options = {})
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 export(options = {}, objects = nil)
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 export(options = {}, object = nil)
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.8
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: 2015-07-11 00:00:00.000000000 Z
12
+ date: 2016-01-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails