Class: DMap::Validations::LengthOf
- Inherits:
-
Object
- Object
- DMap::Validations::LengthOf
- Defined in:
- lib/dmap/validations/length.rb
Instance Attribute Summary collapse
-
#ret ⇒ Object
Returns the value of attribute ret.
Class Method Summary collapse
-
.is_valid?(command) ⇒ Boolean
Return true if it’s valid.
-
.parent_name ⇒ Object
for aliases.
- .ret ⇒ Object
- .validate(command = nil) ⇒ Object
Instance Attribute Details
#ret ⇒ Object
Returns the value of attribute ret.
22 23 24 |
# File 'lib/dmap/validations/length.rb', line 22 def ret @ret end |
Class Method Details
.is_valid?(command) ⇒ Boolean
Return true if it’s valid
34 35 36 37 |
# File 'lib/dmap/validations/length.rb', line 34 def self.is_valid?(command) @ret = DMap::Validations::Core::Numbers.run command !(ret[:min].nil? and ret[:max].nil? and ret[:within].nil? and ret[:equals].nil?) end |
.parent_name ⇒ Object
for aliases
25 26 27 |
# File 'lib/dmap/validations/length.rb', line 25 def self.parent_name "LengthOf" end |
.ret ⇒ Object
29 30 31 |
# File 'lib/dmap/validations/length.rb', line 29 def self.ret @ret end |
.validate(command = nil) ⇒ Object
39 40 41 |
# File 'lib/dmap/validations/length.rb', line 39 def self.validate(command=nil) @ret ||= DMap::Validations::Core::Numbers.run command end |