Class: Riddl::Handlers::PlainType

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby/riddl/handlers/plain-type.rb

Class Method Summary collapse

Class Method Details

.handle(what, hinfo) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/ruby/riddl/handlers/plain-type.rb', line 4

def self::handle(what,hinfo)
  if what.class == Riddl::Parameter::Tempfile
    w = what.read
  else
    w = what
  end
  begin
    hi = XML::Smart::string(hinfo)
    re = Regexp.new(hi.root.text)
  rescue
    return false
  end
  w =~ re
end