Module: UseCaseValidations::Target

Defined in:
lib/usecasing_validations/target.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



5
6
7
# File 'lib/usecasing_validations/target.rb', line 5

def self.included(base)
  base.extend(ClassMethods)
end

Instance Method Details

#parent_targetObject



21
22
23
# File 'lib/usecasing_validations/target.rb', line 21

def parent_target
  parent_target_sym ? send(parent_target_sym) : nil
end

#parent_target_symObject



13
14
15
# File 'lib/usecasing_validations/target.rb', line 13

def parent_target_sym
  self.class.options.key?(:in) ? self.class.options[:in] : nil
end

#targetObject



17
18
19
# File 'lib/usecasing_validations/target.rb', line 17

def target
  send(target_sym)
end

#target_symObject



9
10
11
# File 'lib/usecasing_validations/target.rb', line 9

def target_sym
  self.class.target_sym
end