Sha256: 986e09542f31d6dc77b1aed8691e7088bb8b7675157e9301db0924a73ccf081b

Contents?: true

Size: 487 Bytes

Versions: 19

Compression:

Stored size: 487 Bytes

Contents

require 'json'

module Embulk
  module Guess
    class ZendeskGuess < TextGuessPlugin
      Plugin.register_guess("zendesk", self)

      def guess_text(config, sample_text)
        {:columns =>
             SchemaGuess.from_hash_records(JSON.parse(sample_text)).map do |c|
               {
                   name: c.name,
                   type: c.type,
                   **(c.format ? {format: c.format} : {})
               }
             end
        }
      end
    end
  end
end 

Version data entries

19 entries across 19 versions & 2 rubygems

Version Path
embulk-input-zendesk-all-0.4.5 lib/embulk/guess/zendesk.rb
embulk-input-zendesk-0.3.10-java lib/embulk/guess/zendesk.rb
embulk-input-zendesk-0.3.9-java lib/embulk/guess/zendesk.rb
embulk-input-zendesk-0.3.8-java lib/embulk/guess/zendesk.rb
embulk-input-zendesk-all-0.4.4 lib/embulk/guess/zendesk.rb
embulk-input-zendesk-all-0.4.3 lib/embulk/guess/zendesk.rb
embulk-input-zendesk-all-0.4.1 lib/embulk/guess/zendesk.rb
embulk-input-zendesk-all-0.4.0 lib/embulk/guess/zendesk.rb
embulk-input-zendesk-all-0.3.9 lib/embulk/guess/zendesk.rb
embulk-input-zendesk-0.3.7 lib/embulk/guess/zendesk.rb
embulk-input-zendesk-all-0.3.8 lib/embulk/guess/zendesk.rb
embulk-input-zendesk-all-0.3.7 lib/embulk/guess/zendesk.rb
embulk-input-zendesk-0.3.6 lib/embulk/guess/zendesk.rb
embulk-input-zendesk-0.3.5 lib/embulk/guess/zendesk.rb
embulk-input-zendesk-0.3.4 lib/embulk/guess/zendesk.rb
embulk-input-zendesk-0.3.3 lib/embulk/guess/zendesk.rb
embulk-input-zendesk-0.3.2 lib/embulk/guess/zendesk.rb
embulk-input-zendesk-0.3.1 lib/embulk/guess/zendesk.rb
embulk-input-zendesk-0.3.0 lib/embulk/guess/zendesk.rb