Class: Servactory::Maintenance::Attributes::Option
- Inherits:
-
Object
- Object
- Servactory::Maintenance::Attributes::Option
- Defined in:
- lib/servactory/maintenance/attributes/option.rb
Overview
rubocop:disable Metrics/ClassLength
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#define_conflicts ⇒ Object
readonly
Returns the value of attribute define_conflicts.
-
#define_methods ⇒ Object
readonly
Returns the value of attribute define_methods.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#need_for_checks ⇒ Object
readonly
Returns the value of attribute need_for_checks.
-
#validation_class ⇒ Object
readonly
Returns the value of attribute validation_class.
Instance Method Summary collapse
-
#initialize(name:, attribute:, validation_class:, need_for_checks:, body_fallback:, original_value: nil, body_key: nil, body_value: true, define_methods: nil, define_conflicts: nil, with_advanced_mode: true, **options) ⇒ Option
constructor
rubocop:disable Metrics/MethodLength.
-
#need_for_checks? ⇒ Boolean
rubocop:enable Metrics/MethodLength.
Constructor Details
#initialize(name:, attribute:, validation_class:, need_for_checks:, body_fallback:, original_value: nil, body_key: nil, body_value: true, define_methods: nil, define_conflicts: nil, with_advanced_mode: true, **options) ⇒ Option
rubocop:disable Metrics/MethodLength
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/servactory/maintenance/attributes/option.rb', line 19 def initialize( name:, attribute:, validation_class:, need_for_checks:, body_fallback:, original_value: nil, body_key: nil, body_value: true, define_methods: nil, define_conflicts: nil, with_advanced_mode: true, ** ) @name = name.to_sym @validation_class = validation_class @define_methods = define_methods @define_conflicts = define_conflicts @need_for_checks = need_for_checks @body = construct_body( original_value:, options:, body_key:, body_value:, body_fallback:, with_advanced_mode: ) apply_dynamic_methods_to(attribute:) end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
11 12 13 |
# File 'lib/servactory/maintenance/attributes/option.rb', line 11 def body @body end |
#define_conflicts ⇒ Object (readonly)
Returns the value of attribute define_conflicts.
11 12 13 |
# File 'lib/servactory/maintenance/attributes/option.rb', line 11 def define_conflicts @define_conflicts end |
#define_methods ⇒ Object (readonly)
Returns the value of attribute define_methods.
11 12 13 |
# File 'lib/servactory/maintenance/attributes/option.rb', line 11 def define_methods @define_methods end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
11 12 13 |
# File 'lib/servactory/maintenance/attributes/option.rb', line 11 def name @name end |
#need_for_checks ⇒ Object (readonly)
Returns the value of attribute need_for_checks.
11 12 13 |
# File 'lib/servactory/maintenance/attributes/option.rb', line 11 def need_for_checks @need_for_checks end |
#validation_class ⇒ Object (readonly)
Returns the value of attribute validation_class.
11 12 13 |
# File 'lib/servactory/maintenance/attributes/option.rb', line 11 def validation_class @validation_class end |
Instance Method Details
#need_for_checks? ⇒ Boolean
rubocop:enable Metrics/MethodLength
52 53 54 |
# File 'lib/servactory/maintenance/attributes/option.rb', line 52 def need_for_checks? need_for_checks end |