Method: Jsoning.add_type
- Defined in:
- lib/jsoning.rb
.add_type(klass, options = {}) ⇒ Object
93 94 95 96 97 98 |
# File 'lib/jsoning.rb', line 93 def add_type(klass, = {}) processor = [:processor] raise Jsoning::Error, "Pass in processor that is a proc explaining how to extract the value" unless processor.is_a?(Proc) TYPE_EXTENSIONS[klass.to_s] = processor nil end |