Method: Jsoning.protocol_for
- Defined in:
- lib/jsoning.rb
.protocol_for(klass) ⇒ Object
returns a protocol, or create one if none exists
18 19 20 21 22 23 24 25 |
# File 'lib/jsoning.rb', line 18 def protocol_for(klass) protocol = PROTOCOLS[klass.to_s] if protocol.nil? protocol = Jsoning::Protocol.new(klass) PROTOCOLS[klass.to_s] = protocol end protocol end |