Sha256: e2a38715f8e119fde37855b1cca1bb53d6271bae6a4ee42e095ff836070fc3d9

Contents?: true

Size: 1001 Bytes

Versions: 1

Compression:

Stored size: 1001 Bytes

Contents

require 'wash_out/engine'
require 'wash_out/param'
require 'wash_out/dispatcher'
require 'wash_out/soap'
require 'wash_out/router'
require 'wash_out/type'
require 'wash_out/model'

module ActionDispatch::Routing
  class Mapper
    # Adds the routes for a SOAP endpoint at +controller+.
    def wash_out(controller_name, options={})
      options.reverse_merge!(@scope) if @scope
      controller_class_name = [options[:module], controller_name].compact.join("/")

      match "#{controller_name}/wsdl" => "#{controller_name}#_generate_wsdl", :via => :get
      match "#{controller_name}/action" => WashOut::Router.new(controller_class_name), :defaults => { :action => '_action' }
    end
  end
end

Mime::Type.register "application/soap+xml", :soap
ActiveRecord::Base.send :extend, WashOut::Model

ActionController::Renderers.add :soap do |what, options|
  _render_soap(what, options)
end

module ActionView
  class Base
    cattr_accessor :washout_namespace
    @@washout_namespace = false
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
wash_out-0.4.0 lib/wash_out.rb