Module: Netzke::Core::Configuration::ClassMethods

Defined in:
lib/netzke/core/configuration.rb

Overview

Use to configure a component on the class level, for example:

MyComponent.setup do |config|
  config.enable_awesome_feature = true
end

Instance Method Summary collapse

Instance Method Details

#instance_by_config(config) ⇒ Object

Instance of component by config



46
47
48
49
# File 'lib/netzke/core/configuration.rb', line 46

def instance_by_config(config)
  klass = config[:klass] || config[:class_name].constantize
  klass.new(config)
end

#server_side_config_optionsObject

An array of server class config options that should not be passed to the client class. Can be overridden.



41
42
43
# File 'lib/netzke/core/configuration.rb', line 41

def server_side_config_options
  [:klass, :client_config]
end

#setup {|_self| ... } ⇒ Object

Do class-level config of a component, e.g.:

Netzke::Basepack::GridPanel.setup do |c|
  c.rows_reordering_available = false
end

Yields:

  • (_self)

Yield Parameters:



36
37
38
# File 'lib/netzke/core/configuration.rb', line 36

def setup
  yield self
end