Class: Lookbook::YamlResolver

Inherits:
DataResolver show all
Defined in:
lib/lookbook/services/data/resolvers/yaml_resolver.rb

Constant Summary collapse

MATCHER =
/((?:\{|\[)(.*?)(?:\]|\}))$/m
MATCH_INDEX =
1

Instance Attribute Summary

Attributes inherited from DataResolver

#base_dir, #eval_context, #fallback, #file

Class Method Summary collapse

Methods inherited from DataResolver

#call, #initialize

Methods inherited from Service

call

Constructor Details

This class inherits a constructor from Lookbook::DataResolver

Class Method Details

.resolveable?(input) ⇒ Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/lookbook/services/data/resolvers/yaml_resolver.rb', line 6

def self.resolveable?(input)
  input.to_s.match?(MATCHER) && YamlParser.call(input, fail_silently: true)
end