Sha256: e0232fa4f0a66617d77006ea9ca0b77f323064eb8304057ddd886ec02d6bbe24

Contents?: true

Size: 504 Bytes

Versions: 3

Compression:

Stored size: 504 Bytes

Contents

#encoding: UTF-8
module Str2Duck

  def self.parse string_data_obj
    raise ArgumentError,"invalid input, must be string!" if string_data_obj.class != String
    return_value= nil

    [ :datetime, :date, :time, :true, :false, :float, :integer, :json, :yaml ].each do |method_name|
      if ::Str2Duck::Config.__send__(method_name)
        return_value ||= Str2Duck::Format.__send__ method_name, string_data_obj
      end
    end

    return_value ||= string_data_obj
    return return_value
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
str2duck-1.3.1 lib/str2duck/parser.rb
str2duck-1.3.0 lib/str2duck/parser.rb
str2duck-1.2.0 lib/str2duck/parser.rb