lib/garage/representer.rb in the_garage-2.3.2 vs lib/garage/representer.rb in the_garage-2.3.3
- old
+ new
@@ -164,25 +164,26 @@
else
raise NonEncodableValue, "#{value.class} can not be encoded directly. Forgot to include Garage::Representer?"
end
end
+ PRIMITIVE_CLASSES = [
+ ActiveSupport::TimeWithZone,
+ Date,
+ Time,
+ Integer,
+ Float,
+ Hash,
+ Array,
+ String,
+ NilClass,
+ TrueClass,
+ FalseClass,
+ Symbol,
+ ]
+
def primitive?(value)
- [
- ActiveSupport::TimeWithZone,
- Date,
- Time,
- Bignum,
- Fixnum,
- Float,
- Hash,
- Array,
- String,
- NilClass,
- TrueClass,
- FalseClass,
- Symbol,
- ].any? {|k| value.is_a?(k) }
+ PRIMITIVE_CLASSES.any? {|k| value.is_a?(k) }
end
private
def boolean?(value)