Module: Soybean::SoapAttribute::ClassMethods

Defined in:
lib/soybean/soap_attribute.rb

Instance Method Summary collapse

Instance Method Details

#soap_attribute(*attrs) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/soybean/soap_attribute.rb', line 11

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