Sha256: 442fbd839da98c4a972dc449c6b3970df3f2161cca4fc4e5157d12ce8daf0b04

Contents?: true

Size: 851 Bytes

Versions: 1

Compression:

Stored size: 851 Bytes

Contents

module Sinatra
  module Soap
    class Wsdl

      # class << self
      #   attr_accessor :actions
      # end
      @@actions = {}

      def self.register(name, *args, &block)
        @@actions = {} if @@actions.nil?
        @@actions[name] = {}
        args = args.pop
        unless args.nil?
          args.each do |key, value|
            @@actions[name][key] = value
          end
        end
        @@actions[name][:block] = block if block_given?
      end

      def self.generate
      end

      attr_accessor :action, :block, :arguments

      def initialize(action)
        data = all[action]
        raise Soap::Error, "Undefined Soap Action" if data.nil?
        @action = action
        @block = data[:block]
        @arguments = data.select {|k,v| k != :block}
      end

      def all
        @@actions
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sinatra-soap-0.1.5 lib/sinatra/soap/wsdl.rb