Module: Axiom::Attribute::LengthComparable
Overview
A mixin for attributes that have comparable lengths
Instance Method Summary collapse
-
#initialize(_name, options = EMPTY_HASH) ⇒ undefined
private
Initialize a length comparable attribute.
Methods included from Comparable
Methods included from Function::Predicate::GreaterThan::Methods
Methods included from Function::Predicate::GreaterThanOrEqualTo::Methods
Methods included from Function::Predicate::LessThan::Methods
Methods included from Function::Predicate::LessThanOrEqualTo::Methods
Instance Method Details
#initialize(_name, options = EMPTY_HASH) ⇒ undefined
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initialize a length comparable attribute
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/axiom/attribute/length_comparable.rb', line 26 def initialize(_name, = EMPTY_HASH) super min, max = .values_at(:minimum_length, :maximum_length) if min || max @type = type.new do minimum_length(min) if min maximum_length(max) if max end end end |