method

get_attribute

Importance_0
v1_8_7_72 - Show latest stable - 0 notes - Class: SOAP::Mapping
get_attribute(obj, attr_name) public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/soap/mapping/mapping.rb, line 274
  def self.get_attribute(obj, attr_name)
    if obj.is_a?(::Hash)
      obj[attr_name] || obj[attr_name.intern]
    else
      name = XSD::CodeGen::GenSupport.safevarname(attr_name)
      if obj.instance_variables.include?('@' + name)
        obj.instance_variable_get('@' + name)
      elsif ((obj.is_a?(::Struct) or obj.is_a?(Marshallable)) and
          obj.respond_to?(name))
        obj.__send__(name)
      end
    end
  end
Register or log in to add new notes.