Module: Jade::Decode

Defined in:
lib/jade/decode.rb

Defined Under Namespace

Modules: Desc, Runner Classes: AtField, AtIndex, Custom, Decoder, MissingField, Multiple, WrongType

Class Method Summary collapse

Class Method Details

.type_name(v) ⇒ Object

Public so specialized boundary decoders can emit error values matching the interpreter’s ‘WrongType` format without going through `Runner`.



307
308
309
310
311
312
313
314
315
316
317
318
# File 'lib/jade/decode.rb', line 307

def self.type_name(v)
  case v
  when ::String              then "String"
  when ::Integer             then "Int"
  when ::Float               then "Float"
  when TrueClass, FalseClass then "Bool"
  when ::NilClass            then "null"
  when ::Array               then "Array"
  when ::Hash                then "Object"
  else                            v.class.name
  end
end