Module: LightParams::PropertiesConfiguration::ClassMethods
- Defined in:
- lib/light_params/properties_configuration.rb
Instance Method Summary collapse
- #config ⇒ Object
- #properties(*prop_names) ⇒ Object
- #property(prop_name, options = {}, &block) ⇒ Object
Instance Method Details
#config ⇒ Object
11 12 13 |
# File 'lib/light_params/properties_configuration.rb', line 11 def config @config ||= {} end |
#properties(*prop_names) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/light_params/properties_configuration.rb', line 15 def properties(*prop_names) opts = prop_names.last.is_a?(Hash) ? prop_names.pop : nil prop_names.each do |prop_name| _add_property(prop_name) _add_property_modifications(prop_name, opts || {}) end end |
#property(prop_name, options = {}, &block) ⇒ Object
23 24 25 26 27 28 |
# File 'lib/light_params/properties_configuration.rb', line 23 def property(prop_name, = {}, &block) _add_property(prop_name) _add_property_modifications(prop_name, ) _add_property_validation(prop_name, [:validates]) if [:validates] _add_property_source(prop_name, &block) if block end |