Class: Rack::App::Utils::Parser::Custom

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/app/utils/parser/custom.rb

Instance Method Summary collapse

Constructor Details

#initialize(type) ⇒ Custom

Returns a new instance of Custom.



2
3
4
# File 'lib/rack/app/utils/parser/custom.rb', line 2

def initialize(type)
  @type = type
end

Instance Method Details

#parse(str) ⇒ Object



6
7
8
# File 'lib/rack/app/utils/parser/custom.rb', line 6

def parse(str)
  @type.parse(str)
end

#validate(str) ⇒ Object



10
11
12
13
14
15
# File 'lib/rack/app/utils/parser/custom.rb', line 10

def validate(str)
  parse(str)
  return true
rescue Exception
  return false
end