Class: Shale::Attribute
- Inherits:
-
Object
- Object
- Shale::Attribute
- Extended by:
- T::Sig
- Defined in:
- lib/shale/attribute.rb,
lib/shale/builder/nested_validations.rb
Overview
rubocop:disable Style/Documentation
Instance Attribute Summary collapse
-
#aliases ⇒ Object
Contains the documentation comment for the shale attribute in a Ruby String.
-
#doc ⇒ Object
Contains the documentation comment for the shale attribute in a Ruby String.
-
#return_type ⇒ Object
: untyped.
-
#setter_type ⇒ Object
: untyped.
Instance Method Summary collapse
-
#all_names ⇒ Object
: -> Array.
-
#builder? ⇒ Boolean
Returns ‘true` if the attribute is handled by a shale builder.
-
#mapper? ⇒ Boolean
Returns ‘true` if the attribute is handled by a shale mapper.
-
#validatable? ⇒ Boolean
: -> bool.
Instance Attribute Details
#aliases ⇒ Object
Contains the documentation comment for the shale attribute in a Ruby String. : Array?
24 25 26 |
# File 'lib/shale/attribute.rb', line 24 def aliases @aliases end |
#doc ⇒ Object
Contains the documentation comment for the shale attribute in a Ruby String. : String?
19 20 21 |
# File 'lib/shale/attribute.rb', line 19 def doc @doc end |
#return_type ⇒ Object
: untyped
14 15 16 |
# File 'lib/shale/attribute.rb', line 14 def return_type @return_type end |
#setter_type ⇒ Object
: untyped
11 12 13 |
# File 'lib/shale/attribute.rb', line 11 def setter_type @setter_type end |
Instance Method Details
#all_names ⇒ Object
: -> Array
27 28 29 30 31 32 33 |
# File 'lib/shale/attribute.rb', line 27 def all_names names = [name] aliases = self.aliases return names unless aliases names + aliases end |
#builder? ⇒ Boolean
Returns ‘true` if the attribute is handled by a shale builder.
: -> bool
45 46 47 |
# File 'lib/shale/attribute.rb', line 45 def builder? type.is_a?(Class) && type < Shale::Builder end |
#mapper? ⇒ Boolean
Returns ‘true` if the attribute is handled by a shale mapper.
: -> bool
38 39 40 |
# File 'lib/shale/attribute.rb', line 38 def mapper? type.is_a?(Class) && type < Shale::Mapper end |
#validatable? ⇒ Boolean
: -> bool
97 98 99 |
# File 'lib/shale/builder/nested_validations.rb', line 97 def validatable? Boolean(type.is_a?(Class) && type < ::ActiveModel::Validations) end |