Sha256: a658be4c2253d89425d21b82bef2d48fd5ac2f3940659e254c29c20512cec5d3

Contents?: true

Size: 562 Bytes

Versions: 1

Compression:

Stored size: 562 Bytes

Contents

module Soybean
  module SoapAttribute
    extend ActiveSupport::Concern

    included do
      class_attribute :attributes, :instance_reader => true, :instance_writer => true
      self.attributes = []
    end

    module ClassMethods
      def soap_attribute(*attrs)
        self.attributes += attrs
        attr_accessor *attrs
        attrs.delete_if { |s| s.underscore == s }.each do |meth|
          self.class_eval <<-RUBY
            def #{meth.to_s.underscore}
              #{meth}
            end
          RUBY
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
soybean-2.4.1 lib/core_ext/module.rb