Module: Slim::Validator

Defined in:
lib/slim/validator.rb

Class Method Summary collapse

Class Method Details

.valid?(source) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/slim/validator.rb', line 11

def valid?(source)
  validate!(source) === true
end

.validate!(source) ⇒ Object



4
5
6
7
8
9
# File 'lib/slim/validator.rb', line 4

def validate!(source)
  Slim::Engine.new.compile(source.to_s)
  true
rescue Exception => ex
  ex
end