Module: CassandraObject::Types::HashType
- Defined in:
- lib/cassandra_object/types/hash_type.rb
Class Method Summary collapse
Class Method Details
.decode(str) ⇒ Object
10 11 12 |
# File 'lib/cassandra_object/types/hash_type.rb', line 10 def decode(str) ActiveSupport::JSON.decode(str) end |
.encode(hash) ⇒ Object
4 5 6 7 |
# File 'lib/cassandra_object/types/hash_type.rb', line 4 def encode(hash) raise ArgumentError.new("#{self} requires a Hash") unless hash.kind_of?(Hash) ActiveSupport::JSON.encode(hash) end |