Class: Lutaml::Model::ValidationRule
- Inherits:
-
Object
- Object
- Lutaml::Model::ValidationRule
- Defined in:
- lib/lutaml/model/services/validator.rb
Instance Attribute Summary collapse
-
#attribute ⇒ Object
readonly
Returns the value of attribute attribute.
-
#custom_method ⇒ Object
readonly
Returns the value of attribute custom_method.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #custom? ⇒ Boolean
- #has_options? ⇒ Boolean
-
#initialize(attribute: nil, custom_method: nil, options: {}) ⇒ ValidationRule
constructor
A new instance of ValidationRule.
Constructor Details
#initialize(attribute: nil, custom_method: nil, options: {}) ⇒ ValidationRule
Returns a new instance of ValidationRule.
8 9 10 11 12 13 14 15 16 |
# File 'lib/lutaml/model/services/validator.rb', line 8 def initialize(attribute: nil, custom_method: nil, options: {}) if Utils.blank?(attribute) && Utils.blank?(custom_method) raise ArgumentError, "Missing attribute or custom method" end @attribute = attribute @options = @custom_method = custom_method end |
Instance Attribute Details
#attribute ⇒ Object (readonly)
Returns the value of attribute attribute.
6 7 8 |
# File 'lib/lutaml/model/services/validator.rb', line 6 def attribute @attribute end |
#custom_method ⇒ Object (readonly)
Returns the value of attribute custom_method.
6 7 8 |
# File 'lib/lutaml/model/services/validator.rb', line 6 def custom_method @custom_method end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
6 7 8 |
# File 'lib/lutaml/model/services/validator.rb', line 6 def @options end |