/tools/Ruby/lib/ruby/1.8/wsdl/xmlSchema/pattern.rb

http://github.com/agross/netopenspace · Ruby · 36 lines · 20 code · 11 blank · 5 comment · 0 complexity · 984410b5a5e7217b63e14d629a450d0e MD5 · raw file

  1. # WSDL4R - XMLSchema pattern definition for WSDL.
  2. # Copyright (C) 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
  3. # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
  4. # redistribute it and/or modify it under the same terms of Ruby's license;
  5. # either the dual license version in 2003, or any later version.
  6. require 'wsdl/info'
  7. module WSDL
  8. module XMLSchema
  9. class Pattern < Info
  10. def initialize
  11. super
  12. end
  13. def parse_element(element)
  14. nil
  15. end
  16. def parse_attr(attr, value)
  17. case attr
  18. when ValueAttrName
  19. parent.pattern = /\A#{value.source}\z/n
  20. value.source
  21. end
  22. end
  23. end
  24. end
  25. end