Module: UseCaseValidations::Target::ClassMethods
- Defined in:
- lib/usecasing_validations/target.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#target_sym ⇒ Object
readonly
Returns the value of attribute target_sym.
Instance Method Summary collapse
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
27 28 29 |
# File 'lib/usecasing_validations/target.rb', line 27 def end |
#target_sym ⇒ Object (readonly)
Returns the value of attribute target_sym.
27 28 29 |
# File 'lib/usecasing_validations/target.rb', line 27 def target_sym @target_sym end |
Instance Method Details
#target(target_sym, options = {}) ⇒ Object
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/usecasing_validations/target.rb', line 29 def target(target_sym, = {}) @target_sym, = target_sym, if .key?(:in) define_method([:in]) { context.send([:in]) } define_method(target_sym) { send([:in]).send(target_sym) } else define_method(target_sym) { context.send(target_sym) } end end |