Module: Aequitas::VirtusIntegration::InlineAttributeRuleExtractor
- Defined in:
- lib/aequitas/virtus_integration/inline_attribute_rule_extractor.rb,
lib/aequitas/virtus_integration/inline_attribute_rule_extractor/array.rb,
lib/aequitas/virtus_integration/inline_attribute_rule_extractor/object.rb,
lib/aequitas/virtus_integration/inline_attribute_rule_extractor/string.rb,
lib/aequitas/virtus_integration/inline_attribute_rule_extractor/boolean.rb,
lib/aequitas/virtus_integration/inline_attribute_rule_extractor/numeric.rb
Defined Under Namespace
Classes: Array, Boolean, Numeric, Object, String
Class Method Summary collapse
Class Method Details
.extract(attribute) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/aequitas/virtus_integration/inline_attribute_rule_extractor.rb', line 7 def self.extract(attribute) type = case attribute when ::Virtus::Attribute::Boolean; self::Boolean when ::Virtus::Attribute::String; self::String when ::Virtus::Attribute::Array; self::Array # when ::Virtus::Attribute::Decimal; self::Decimal # when ::Virtus::Attribute::Float; self::Float when ::Virtus::Attribute::Numeric; self::Numeric when ::Virtus::Attribute::Object; self::Object end type.new(attribute).extract end |