Sha256: e6e5aa62811ab94a0820caff9cdebb1fd2998f2178ec55901b2225859873597d

Contents?: true

Size: 449 Bytes

Versions: 8

Compression:

Stored size: 449 Bytes

Contents

module Transcriber
  class Resource
    module InputPath
      def self.resolve(options, convert_input_keys = Key::Converter::DefaultHandler)
        convert_input_keys.call keys_for_path(custom_path(options))
      end

      private

      def self.custom_path(options)
        options.slice(:start_key, :field)
      end

      def self.keys_for_path(path)
        path.empty? ? [] : path.values.first.to_s.split('.')
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
transcriber-0.0.9 lib/transcriber/resource/input_path.rb
transcriber-0.0.8 lib/transcriber/resource/input_path.rb
transcriber-0.0.7 lib/transcriber/resource/input_path.rb
transcriber-0.0.6 lib/transcriber/resource/input_path.rb
transcriber-0.0.5 lib/transcriber/resource/input_path.rb
transcriber-0.0.4 lib/transcriber/resource/input_path.rb
transcriber-0.0.3 lib/transcriber/resource/input_path.rb
transcriber-0.0.2 lib/transcriber/resource/input_path.rb