cell_set 0.2.2 → 0.2.3

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.
@@ -5,7 +5,7 @@ require 'active_support/core_ext/hash/deep_merge'
5
5
 
6
6
  module CellSet
7
7
  class CellSet
8
- ATTRIBUTES = [:axes]
8
+ ATTRIBUTES = [:axes, :encode]
9
9
 
10
10
  include Attributes
11
11
  include SeriesList
@@ -155,7 +155,7 @@ module CellSet
155
155
  hsh.each do |key, value|
156
156
  newhsh[key] = {}
157
157
  value.each do |key2, value2|
158
- newhsh[key][key2] = if value2.is_a?(String)
158
+ newhsh[key][key2] = if @encode && value2.is_a?(String)
159
159
  Base64.urlsafe_decode64(value2)
160
160
  else
161
161
  value2
@@ -170,7 +170,7 @@ module CellSet
170
170
  hsh.each do |key, value|
171
171
  newhsh[key] = {}
172
172
  value.each do |key2, value2|
173
- newhsh[key][key2] = if value2.is_a?(String)
173
+ newhsh[key][key2] = if @encode && value2.is_a?(String)
174
174
  Base64.urlsafe_encode64(value2)
175
175
  else
176
176
  value2
@@ -1,3 +1,3 @@
1
1
  module Version
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
@@ -153,7 +153,8 @@ describe CellSet::CellSet do
153
153
  it "should serialize" do
154
154
  cell_set.as_json.should == {
155
155
  "axes" => [column_axis, row_axis],
156
- "cells" => {}
156
+ "cells" => {},
157
+ "encode" => nil
157
158
  }
158
159
  end
159
160
 
@@ -161,7 +162,8 @@ describe CellSet::CellSet do
161
162
  cell_set.as_json(:root => true).should == {
162
163
  "cell_set" => {
163
164
  "axes" => [column_axis, row_axis],
164
- "cells" => {}
165
+ "cells" => {},
166
+ "encode" => nil
165
167
  }
166
168
  }
167
169
  end
@@ -174,7 +176,8 @@ describe CellSet::CellSet do
174
176
 
175
177
  it "should serialize excluding cells" do
176
178
  cell_set.as_json(:except => "cells").should == {
177
- "axes" => [column_axis, row_axis]
179
+ "axes" => [column_axis, row_axis],
180
+ "encode" => nil
178
181
  }
179
182
  end
180
183
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cell_set
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: