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.
6 7 8 9 10 11 12 13 14 |
# File 'lib/lutaml/model/services/validator.rb', line 6 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.
4 5 6 |
# File 'lib/lutaml/model/services/validator.rb', line 4 def attribute @attribute end |
#custom_method ⇒ Object (readonly)
Returns the value of attribute custom_method.
4 5 6 |
# File 'lib/lutaml/model/services/validator.rb', line 4 def custom_method @custom_method end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
4 5 6 |
# File 'lib/lutaml/model/services/validator.rb', line 4 def @options end |