Sha256: 429f311a3d92090d0db4501141d00ba92affa9549d09f2333a6730ac262a2d16

Contents?: true

Size: 572 Bytes

Versions: 1

Compression:

Stored size: 572 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.to_s.underscore == s.to_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.2 lib/core_ext/module.rb