Method: Dhall::Coder#load_async
- Defined in:
- lib/dhall/coder.rb
#load_async(source, op = "load_async", transform_keys: :to_s, timeout: 10) ⇒ Object
52 53 54 55 56 57 58 59 |
# File 'lib/dhall/coder.rb', line 52 def load_async(source, op="load_async", transform_keys: :to_s, timeout: 10) return Promise.resolve(@default) if source.nil? return Promise.resolve(source) unless source.is_a?(String) Dhall.load(source, timeout: timeout).then do |expr| decode(expr, op, transform_keys: transform_keys) end end |