Module: RunCl::ActAsRun::ClassMethods
- Defined in:
- lib/run_cl.rb
Overview
module InstanceMethods end
Instance Method Summary collapse
-
#has_run_cl(name, options = {}) ⇒ Object
include InstanceMethods.
Instance Method Details
#has_run_cl(name, options = {}) ⇒ Object
include InstanceMethods
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/run_cl.rb', line 18 def has_run_cl(name, = {}) run = .delete(:run) uniq_run = .delete(:uniq_run) skip_db_format_clear = .delete(:skip_db_format_clear) if run.nil? or run validates name, .merge({run: true}) end if uniq_run.class == Hash and uniq_run.keys.any? validates name, .merge({uniq_run: uniq_run}) elsif uniq_run.nil? or uniq_run == true validates name, .merge({uniq_run: true}) end if skip_db_format_clear.nil? or skip_db_format_clear == false before_validation :"make_#{name}_format!" define_method "make_#{name}_format!" do self.send("#{name}=", Run.remove_format(self.send("#{name}")) ) end end end |