Class: Ehcache::Config::YamlConfig::YamlConfigBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/ehcache/yaml_config.rb

Instance Method Summary collapse

Constructor Details

#initialize(yaml_file) ⇒ YamlConfigBuilder

Returns a new instance of YamlConfigBuilder.



119
120
121
122
123
# File 'lib/ehcache/yaml_config.rb', line 119

def initialize(yaml_file)
  @yaml_file = yaml_file
  @data = YAML.load(ERB.new(File.read(yaml_file)).result(binding))
  raise InvalidYamlConfiguration unless valid?(@data)
end

Instance Method Details

#buildObject



125
126
127
128
129
130
131
132
133
134
135
136
137
138
# File 'lib/ehcache/yaml_config.rb', line 125

def build
  @config = Configuration.new
  for attribute in [NAME, UPDATE_CHECK, MONITORING, DYNAMIC_CONFIG]
    set_if_present(attribute)
  end
  set_disk_store
  set_transaction_manager
  set_event_listener
  add_peer_providers
  add_peer_listeners
  set_default_cache
  add_caches
  @config
end