Sha256: c3a99102dd76ed236e74e01d7c8eff3aaf69e1cbf8ed9a0b25aa3919eb8b291e

Contents?: true

Size: 596 Bytes

Versions: 7

Compression:

Stored size: 596 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 = (self.attributes + attrs).uniq
        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

7 entries across 7 versions & 1 rubygems

Version Path
soybean-2.5.5 lib/soybean/soap_attribute.rb
soybean-2.5.4 lib/soybean/soap_attribute.rb
soybean-2.5.3 lib/soybean/soap_attribute.rb
soybean-2.5.2 lib/soybean/soap_attribute.rb
soybean-2.5.1 lib/soybean/soap_attribute.rb
soybean-2.5.0 lib/soybean/soap_attribute.rb
soybean-2.4.3 lib/core_ext/module.rb