Module: Rules::Parameters
- Defined in:
- lib/rules/parameters.rb,
lib/rules/parameters/constant.rb,
lib/rules/parameters/attribute.rb,
lib/rules/parameters/parameter.rb,
lib/rules/parameters/constant_definitions.rb
Defined Under Namespace
Classes: Attribute, Constant, Parameter
Class Method Summary
collapse
Class Method Details
.constants ⇒ Object
9
10
11
|
# File 'lib/rules/parameters.rb', line 9
def self.constants
@@constants
end
|
.define_constant(key, &block) ⇒ Object
13
14
15
16
17
18
|
# File 'lib/rules/parameters.rb', line 13
def self.define_constant(key, &block)
raise "Constant #{key} already exists" if @@constants[key]
constant = Constant.new(key: key)
constant.instance_eval(&block) if block_given?
@@constants[key] = constant
end
|