Class: DMap::Validations::Lazy

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#propertyObject

Returns the value of attribute property.



19
20
21
# File 'lib/dmap/validations/misc.rb', line 19

def property
  @property
end

Class Method Details

.is_valid?(command = nil) ⇒ Boolean

Returns:

  • (Boolean)


23
24
25
26
# File 'lib/dmap/validations/misc.rb', line 23

def self.is_valid?(command=nil)
  command ||= "true"
  (command == "true" or command == "false" or !command.match('^[\:A-Za-z_\-]+$').nil?)
end

.propertyObject



21
# File 'lib/dmap/validations/misc.rb', line 21

def self.property; true; end

.validate(command = nil) ⇒ Object



28
29
30
31
32
33
34
# File 'lib/dmap/validations/misc.rb', line 28

def self.validate(command=nil)
  if command == "true" or command == "false"
    command
  else
    DMap::Validations::Core::When.run(command)
  end
end