Class: Aequitas::VirtusIntegration::InlineAttributeRuleExtractor::Object
- Inherits:
-
Object
- Object
- Aequitas::VirtusIntegration::InlineAttributeRuleExtractor::Object
show all
- Defined in:
- lib/aequitas/virtus_integration/inline_attribute_rule_extractor/object.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(attribute) ⇒ Object
Returns a new instance of Object.
12
13
14
|
# File 'lib/aequitas/virtus_integration/inline_attribute_rule_extractor/object.rb', line 12
def initialize(attribute)
@attribute = attribute
end
|
Instance Attribute Details
#attribute ⇒ Object
Returns the value of attribute attribute.
10
11
12
|
# File 'lib/aequitas/virtus_integration/inline_attribute_rule_extractor/object.rb', line 10
def attribute
@attribute
end
|
Instance Method Details
20
21
22
23
24
|
# File 'lib/aequitas/virtus_integration/inline_attribute_rule_extractor/object.rb', line 20
def
inline_rules = []
inline_rules.concat Array()
end
|
26
27
28
29
|
# File 'lib/aequitas/virtus_integration/inline_attribute_rule_extractor/object.rb', line 26
def
required = options.fetch(:required, false)
Rule::Presence::NotBlank.new(attribute.name) if required
end
|
31
32
33
|
# File 'lib/aequitas/virtus_integration/inline_attribute_rule_extractor/object.rb', line 31
def
Rule::PrimitiveType::Virtus.new(attribute.name, :attribute => attribute)
end
|
16
17
18
|
# File 'lib/aequitas/virtus_integration/inline_attribute_rule_extractor/object.rb', line 16
def options
attribute.options
end
|