class EasySettings::KeyDSL

EasySettings::KeyDSL

For a comfortable way how to set new key via DSL

Attributes

options[R]

Public Class Methods

new() click to toggle source
# File lib/redmine_extensions/easy_settings/key_dsl.rb, line 11
def initialize
  @options = {}
end

Public Instance Methods

after_save(func=nil, &block) click to toggle source
# File lib/redmine_extensions/easy_settings/key_dsl.rb, line 39
def after_save(func=nil, &block)
  @options[:after_save] = func || block
end
default(new_default) click to toggle source
# File lib/redmine_extensions/easy_settings/key_dsl.rb, line 19
def default(new_default)
  @options[:default] = new_default
end
disabled_from_params() click to toggle source
# File lib/redmine_extensions/easy_settings/key_dsl.rb, line 23
def disabled_from_params
  @options[:disabled_from_params] = true
end
from_params(func=nil, &block) click to toggle source
# File lib/redmine_extensions/easy_settings/key_dsl.rb, line 31
def from_params(func=nil, &block)
  @options[:from_params] = func || block
end
skip_blank_params() click to toggle source
# File lib/redmine_extensions/easy_settings/key_dsl.rb, line 27
def skip_blank_params
  @options[:skip_blank_params] = true
end
type(new_type) click to toggle source
# File lib/redmine_extensions/easy_settings/key_dsl.rb, line 15
def type(new_type)
  @options[:type] = new_type
end
validate(func=nil, &block) click to toggle source
# File lib/redmine_extensions/easy_settings/key_dsl.rb, line 35
def validate(func=nil, &block)
  @options[:validate] = func || block
end