module Ytrbium::DSL
Public Instance Methods
call(options = {})
click to toggle source
# File lib/ytrbium/dsl.rb, line 16 def call(options = {}) YAML.safe_load expand(binding) end
engine(input = nil, options = {})
click to toggle source
# File lib/ytrbium/dsl.rb, line 7 def engine(input = nil, options = {}) @engine = nil if input @engine ||= Engine.new(input, options) end
expand(binding = nil)
click to toggle source
# File lib/ytrbium/dsl.rb, line 12 def expand(binding = nil) engine.expand(binding) end
expand_path(name)
click to toggle source
# File lib/ytrbium/dsl.rb, line 20 def expand_path(name) file_resolver.expand_path name end
file_resolver()
click to toggle source
# File lib/ytrbium/dsl.rb, line 3 def file_resolver @file_resolver ||= FileResolver.new end
import(name, as: nil, **options)
click to toggle source
# File lib/ytrbium/dsl.rb, line 24 def import(name, as: nil, **options) mod = Ytrbium.dsl file_resolver.load(name) do |io, filename| mod.engine(io.read, filename: filename, module: mod) end if as define_method(as) { mod } else mod.call(options || {}) end end