module MR::JsonField
Constants
- DEFAULT_DECODER
- DEFAULT_ENCODER
- InvalidJSONError
Public Class Methods
decode(value)
click to toggle source
# File lib/mr/json_field.rb, line 26 def self.decode(value) self.decoder.call(value) rescue StandardError => exception raise InvalidJSONError, exception.message end
decoder()
click to toggle source
# File lib/mr/json_field.rb, line 17 def self.decoder; @decoder ||= DEFAULT_DECODER; end
decoder=(new_value)
click to toggle source
# File lib/mr/json_field.rb, line 18 def self.decoder=(new_value); @decoder = new_value; end
encode(value)
click to toggle source
# File lib/mr/json_field.rb, line 20 def self.encode(value) self.encoder.call(value) rescue StandardError => exception raise InvalidJSONError, exception.message end
encoder()
click to toggle source
# File lib/mr/json_field.rb, line 14 def self.encoder; @encoder ||= DEFAULT_ENCODER; end
encoder=(new_value)
click to toggle source
# File lib/mr/json_field.rb, line 15 def self.encoder=(new_value); @encoder = new_value; end