Sha256: 350f396f285423bb171f139742f4833e568fa0e1a2b187d648048c944d603637

Contents?: true

Size: 194 Bytes

Versions: 9

Compression:

Stored size: 194 Bytes

Contents

# frozen_string_literal: false

class StringParser < Sinclair::Caster
  master_caster!

  cast_with(JSON) { |value| JSON.parse(value) }
  cast_with(Integer, :to_i)
  cast_with(Float, :to_f)
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
sinclair-2.1.1 spec/support/models/string_parser.rb
sinclair-2.1.0 spec/support/models/string_parser.rb
sinclair-2.0.1 spec/support/models/string_parser.rb
sinclair-2.0.0 spec/support/models/string_parser.rb
sinclair-1.16.3 spec/support/models/string_parser.rb
sinclair-1.16.2 spec/support/models/string_parser.rb
sinclair-1.16.1 spec/support/models/string_parser.rb
sinclair-1.16.0 spec/support/models/string_parser.rb
sinclair-1.15.0 spec/support/models/string_parser.rb