Module: Temple::Mixins::Options

Included in:
Engine, Filter, Generator, Parser
Defined in:
lib/temple/mixins/options.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#optionsObject (readonly)



79
80
81
# File 'lib/temple/mixins/options.rb', line 79

def options
  @options
end

Class Method Details

.included(base) ⇒ Object



72
73
74
75
76
77
# File 'lib/temple/mixins/options.rb', line 72

def self.included(base)
  base.class_eval do
    extend ClassOptions
    extend ThreadOptions
  end
end

Instance Method Details

#initialize(opts = {}) ⇒ Object



81
82
83
84
85
# File 'lib/temple/mixins/options.rb', line 81

def initialize(opts = {})
  self.class.options.validate_map!(opts)
  self.class.options.validate_map!(self.class.thread_options) if self.class.thread_options
  @options = ImmutableMap.new({}.update(self.class.options).update(self.class.thread_options || {}).update(opts))
end