File: from_map_mode.rb

package info (click to toggle)
ruby-hocon 1.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 768 kB
  • sloc: ruby: 7,903; makefile: 4
file content (18 lines) | stat: -rw-r--r-- 507 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# encoding: utf-8

require_relative '../../hocon/impl'
require_relative '../../hocon/config_error'

module Hocon::Impl::FromMapMode
  KEYS_ARE_PATHS = 0
  KEYS_ARE_KEYS = 1
  ConfigBugOrBrokenError = Hocon::ConfigError::ConfigBugOrBrokenError

  def self.map_mode_name(from_map_mode)
    case from_map_mode
      when KEYS_ARE_PATHS then "KEYS_ARE_PATHS"
      when KEYS_ARE_KEYS then "KEYS_ARE_KEYS"
      else raise ConfigBugOrBrokenError.new("Unrecognized FromMapMode #{from_map_mode}")
    end
  end
end