Sha256: fcd42f5c792fbd012b112f570e081e8d8a156b56b1ae6780ec41d0bd677976a5

Contents?: true

Size: 1.18 KB

Versions: 5

Compression:

Stored size: 1.18 KB

Contents

# WSDL4R - XMLSchema simpleContent definition for WSDL.
# Copyright (C) 2004, 2005  NAKAMURA, Hiroshi <nahi@ruby-lang.org>.

# This program is copyrighted free software by NAKAMURA, Hiroshi.  You can
# redistribute it and/or modify it under the same terms of Ruby's license;
# either the dual license version in 2003, or any later version.


require 'action_web_service/wsdl/info'
require 'action_web_service/xsd/namedelements'


module WSDL
module XMLSchema


class SimpleContent < Info
  attr_reader :restriction
  attr_reader :extension

  def check_lexical_format(value)
    check(value)
  end

  def initialize
    super
    @restriction = nil
    @extension = nil
  end

  def base
    content.base
  end

  def targetnamespace
    parent.targetnamespace
  end

  def parse_element(element)
    case element
    when RestrictionName
      @restriction = SimpleRestriction.new
      @restriction
    when ExtensionName
      @extension = SimpleExtension.new
      @extension
    end
  end

private

  def content
    @restriction || @extension
  end

  def check(value)
    unless content.valid?(value)
      raise XSD::ValueSpaceError.new("#{@name}: cannot accept '#{value}'")
    end
  end
end


end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
reidiculous-actionwebservice-client-3.0.10 lib/action_web_service/wsdl/xmlSchema/simpleContent.rb
reidiculous-actionwebservice-client-3.0.6 lib/action_web_service/wsdl/xmlSchema/simpleContent.rb
reidiculous-actionwebservice-client-3.0.4.1 lib/action_web_service/wsdl/xmlSchema/simpleContent.rb
reidiculous-actionwebservice-client-3.0.4 lib/action_web_service/wsdl/xmlSchema/simpleContent.rb
reidiculous-actionwebservice-3.0.3 lib/action_web_service/wsdl/xmlSchema/simpleContent.rb