File: resolve_status.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 (20 lines) | stat: -rw-r--r-- 348 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# encoding: utf-8

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

class Hocon::Impl::ResolveStatus
  UNRESOLVED = 0
  RESOLVED = 1

  def self.from_values(values)
    if values.any? { |v| v.resolve_status == UNRESOLVED }
      UNRESOLVED
    else
      RESOLVED
    end
  end

  def self.from_boolean(resolved)
    resolved ? RESOLVED : UNRESOLVED
  end
end