Sha256: 1247144ce83dc4d752c915c5e89de77aad0e6915754c68d2cfb3a4f8d5065748

Contents?: true

Size: 681 Bytes

Versions: 10

Compression:

Stored size: 681 Bytes

Contents

module WashoutBuilder
  class Type
    BASIC_TYPES = %w(string integer double boolean date datetime float time int)

    def self.all_fault_classes
      faults = []
      faults << WashOut::SOAPError if defined?(WashOut::SOAPError)
      faults << WashOut::Dispatcher::SOAPError if defined?(WashOut::Dispatcher::SOAPError)
      faults << SOAPError if defined?(SOAPError)
      faults
    end

    def self.ancestor_fault?(fault_class)
      fault_class.ancestors.find { |fault| all_fault_classes.include?(fault) }.present?
    end

    def self.valid_fault_class?(fault)
      fault.is_a?(Class) && (ancestor_fault?(fault) || all_fault_classes.include?(fault))
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
washout_builder-0.16.1 lib/washout_builder/type.rb
washout_builder-0.16.0 lib/washout_builder/type.rb
washout_builder-0.15.8 lib/washout_builder/type.rb
washout_builder-0.15.7 lib/washout_builder/type.rb
washout_builder-0.15.6 lib/washout_builder/type.rb
washout_builder-0.15.5 lib/washout_builder/type.rb
washout_builder-0.15.4 lib/washout_builder/type.rb
washout_builder-0.15.3 lib/washout_builder/type.rb
washout_builder-0.15.1 lib/washout_builder/type.rb
washout_builder-0.15.0 lib/washout_builder/type.rb