Class: RubyHaze::MapConfig

Inherits:
Object
  • Object
show all
Includes:
RubyHaze::Mixins::Proxy
Defined in:
lib/rubyhaze/configs/map.rb

Instance Attribute Summary

Attributes included from RubyHaze::Mixins::Proxy

#proxy_object

Class Method Summary collapse

Instance Method Summary collapse

Methods included from RubyHaze::Mixins::Proxy

included, #method_missing, #respond_to?

Constructor Details

#initialize(name, options = nil) ⇒ MapConfig

Returns a new instance of MapConfig.



12
13
14
15
16
17
# File 'lib/rubyhaze/configs/map.rb', line 12

def initialize(name, options = nil)
  @proxy_object = Java::ComHazelcastConfig::MapConfig.new
  self.name = name.to_s
  options ||= self.class.default_options
  options.each { |k,v| send "#{k}=", v }
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RubyHaze::Mixins::Proxy

Class Method Details

.[](name) ⇒ Object



25
26
27
# File 'lib/rubyhaze/configs/map.rb', line 25

def [](name)
  RubyHaze.config.map_config name.to_s
end

.default_optionsObject



21
22
23
# File 'lib/rubyhaze/configs/map.rb', line 21

def default_options
  { :backup_count => 1, :eviction_policy => 'NONE', :max_size => 0, :eviction_percentage => 25 }
end