Class: KDomain::DomainModel::Validate

Inherits:
Object
  • Object
show all
Defined in:
lib/k_domain/schemas/domain/old/validate.rb

Constant Summary collapse

KEYS =
[:on].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#methodsObject

Returns the value of attribute methods.



8
9
10
# File 'lib/k_domain/schemas/domain/old/validate.rb', line 8

def methods
  @methods
end

#onObject

Returns the value of attribute on.



10
11
12
# File 'lib/k_domain/schemas/domain/old/validate.rb', line 10

def on
  @on
end

Instance Method Details

#for_template(value) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/k_domain/schemas/domain/old/validate.rb', line 16

def for_template(value)
  return nil if value.nil?
  return value.to_s if value.is_a?(Hash)
  return ":#{value}" if value.is_a?(Symbol)

  value
end

#format_onObject



12
13
14
# File 'lib/k_domain/schemas/domain/old/validate.rb', line 12

def format_on
  for_template(on)
end