Module: Shale::Builder::NestedValidations::ClassMethods
- Extended by:
- T::Sig
- Defined in:
- lib/shale/builder/nested_validations.rb
Overview
@requires_ancestor: singleton(Shale::Mapper)
Instance Attribute Summary collapse
-
#nested_attr_name_separator ⇒ Object
: -> String.
Instance Method Summary collapse
-
#validatable_attribute_names ⇒ Object
: -> Array.
-
#validatable_attributes ⇒ Object
: -> Hash[Symbol, Shale::Attribute].
Instance Attribute Details
#nested_attr_name_separator ⇒ Object
: -> String
25 26 27 28 29 30 31 32 |
# File 'lib/shale/builder/nested_validations.rb', line 25 def nested_attr_name_separator return @nested_attr_name_separator if @nested_attr_name_separator s = superclass return @nested_attr_name_separator = s.nested_attr_name_separator if s < NestedValidations @nested_attr_name_separator = '.' end |
Instance Method Details
#validatable_attribute_names ⇒ Object
: -> Array
42 43 44 |
# File 'lib/shale/builder/nested_validations.rb', line 42 def validatable_attribute_names validatable_attributes.keys end |
#validatable_attributes ⇒ Object
: -> Hash[Symbol, Shale::Attribute]
35 36 37 38 39 |
# File 'lib/shale/builder/nested_validations.rb', line 35 def validatable_attributes @validatable_attributes ||= attributes.select do |_, val| val.validatable? end end |