Module: CassandraArchive::Helper
- Defined in:
- lib/cassandra_archive/helper.rb
Class Method Summary collapse
Class Method Details
.encode_for_cassandra(str, opts = {}) ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/cassandra_archive/helper.rb', line 7 def self.encode_for_cassandra(str, opts = {}) encode_opts = { :invalid => :replace, :undef => :replace, :replace => '' }.merge(opts) str.encode('UTF-8', encode_opts).force_encoding('ASCII-8BIT') end |
.timestamp(time) ⇒ Object
3 4 5 |
# File 'lib/cassandra_archive/helper.rb', line 3 def self.(time) (time.to_f * 1_000_000).to_i end |