Netzke::Configuration::InstanceMethods

Public Instance Methods

config() click to toggle source

Resulting config that takes into account all possible ways to configure a component. *Read only*. Translates into something like this:

default_config.
deep_merge(@passed_config).
deep_merge(persistent_options).
deep_merge(strong_parent_config).
deep_merge(strong_session_config)

Moved out to a separate method in order to provide for easy caching. *Do not override this method*, use Base.config instead.

# File lib/netzke/configuration.rb, line 131
def config
  @config ||= configuration
end
configuration() click to toggle source
# File lib/netzke/configuration.rb, line 116
def configuration
  final_config
end
default_config() click to toggle source

Default config - before applying any passed configuration

# File lib/netzke/configuration.rb, line 93
def default_config
  @default_config ||= {}.merge(weak_default_options).merge(self.class.default_instance_config)
end
final_config() click to toggle source

Last level config, overridden only by ineritance

# File lib/netzke/configuration.rb, line 112
def final_config
  @strong_config ||= session_config.merge(weak_final_options).merge(strong_parent_config)
end
flat_config(key = nil) click to toggle source
# File lib/netzke/configuration.rb, line 135
def flat_config(key = nil)
  fc = config.flatten_with_type
  key.nil? ? fc : fc.select{ |c| c[:name] == key.to_sym }.first.try(:value)
end
flat_default_config(key = nil) click to toggle source
# File lib/netzke/configuration.rb, line 149
def flat_default_config(key = nil)
  fc = default_config.flatten_with_type
  key.nil? ? fc : fc.select{ |c| c[:name] == key.to_sym }.first.try(:value)
end
flat_independent_config(key = nil) click to toggle source
# File lib/netzke/configuration.rb, line 144
def flat_independent_config(key = nil)
  fc = independent_config.flatten_with_type
  key.nil? ? fc : fc.select{ |c| c[:name] == key.to_sym }.first.try(:value)
end
flat_initial_config(key = nil) click to toggle source
# File lib/netzke/configuration.rb, line 154
def flat_initial_config(key = nil)
  fc = initial_config.flatten_with_type
  key.nil? ? fc : fc.select{ |c| c[:name] == key.to_sym }.first.try(:value)
end
independent_config() click to toggle source

Config that is not overridden by parents and sessions

# File lib/netzke/configuration.rb, line 103
def independent_config
  @independent_config ||= initial_config.merge(weak_independent_options).merge(initial_config[:persistence] ? persistent_options : {})
end
initial_config() click to toggle source

Static, hardcoded config. Consists of default values merged with config that was passed during instantiation

# File lib/netzke/configuration.rb, line 98
def initial_config
  @initial_config ||= default_config.merge(weak_initial_options).merge(@passed_config)
end
session_config() click to toggle source
# File lib/netzke/configuration.rb, line 107
def session_config
  @session_config ||= independent_config.merge(weak_session_options).merge(session_options)
end
strong_children_config() click to toggle source

This config will be picked up by all the descendants

# File lib/netzke/configuration.rb, line 176
def strong_children_config
  @strong_children_config ||= parent.nil? ? {} : parent.strong_children_config
end
strong_parent_config() click to toggle source
# File lib/netzke/configuration.rb, line 140
def strong_parent_config
  @strong_parent_config ||= parent.nil? ? {} : parent.strong_children_config
end
weak_children_config() click to toggle source

configuration of all children will get reverse_deep_merge’d with weak_children_config def weak_children_config= ©

@weak_children_config = c

end

# File lib/netzke/configuration.rb, line 185
def weak_children_config
  @weak_children_config ||= {}
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.