Sha256: b78eb580ebec07fab47df8407ab8cbb0a18699820ae93cd7feb176f52a3e740d
Contents?: true
Size: 732 Bytes
Versions: 1
Compression:
Stored size: 732 Bytes
Contents
require 'dry-struct' module TranslatorText # Includes all the types for the exchanges with the API module Types include Dry::Types.module Symbol = Types::Symbol.constructor do |str| str ? str.to_sym : str end class << self def Sentence(item) if item.is_a?(Types::Sentence) item elsif item.is_a?(String) Types::Sentence.new(Text: item) end end end module JSON def to_json(*args) to_hash.to_json(*args) end end end end require_relative 'types/sentence' require_relative 'types/translation' require_relative 'types/translation_result' require_relative 'types/alternative' require_relative 'types/detection_result'
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
translator-text-0.1.0 | lib/translator_text/types.rb |