Class: DMap::Validations::LengthOf

Inherits:
Object
  • Object
show all
Defined in:
lib/dmap/validations/length.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#retObject

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

Returns:

  • (Boolean)


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_nameObject

for aliases



25
26
27
# File 'lib/dmap/validations/length.rb', line 25

def self.parent_name
  "LengthOf"
end

.retObject



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