YARD macro to generated friendly
 documentation for attributes.

 @macro [attach] attribute
  @method $2
  @return [$1] value of $3 property
489989
def attribute(type, method, attr)
      typed_attributes[type] << [method, attr]
      define_attribute(type, method, attr)
    end
1008680
def define_associate_delegation(associate)
      methods = [associate.attribute_names, associate.attribute_names.map { |attr| "#{attr}=" }].flatten
      send(:delegate, *methods, to: associate.name)
    end
250342
function(el) {
      (el.length > 0) && (el = el[0]);
      var orgAttributes = {};
      for (var i=0; i<el.attributes.length; i++) {
        var attr = el.attributes[i];
        orgAttributes[attr.name] = attr.value;
      }
      return orgAttributes;
    }
930765
def import_ab_person
      @attributes = {}
      @modification_date = nil

      SingleValuePropertyMap.each do |ab_property, attr_key|
        if value = get_field(ab_property)
          @attributes[attr_key] = value
        end
      end

      if organization?
        @attributes[:is_org] = true
      end

      MultiValuePropertyMap.each do |ab_property, attr_key|
        if value = get_multi_valued(ab_property)
          if value.any?
            @attributes[attr_key] = value.attributes
          end
        end
      end

      @attributes
    end
390061
def method_missing(method, *args, &block)
      
      attribute = ActiveSupport::Inflector.camelize(method.to_s, false)
  
      if attribute =~ /=$/
        attribute = attribute.chop
        return super unless self.attributes.include?(attribute)
        self.changed_attributes[attribute] = args[0]
        self.attributes[attribute] = args[0]
      else
        return super unless self.attributes.include?(attribute)
        self.attributes[attribute]
      end 
            
    end
986056
def attributes=(attributes)
      model = self.model
      attributes.each do |name, value|
        case name
          when String, Symbol
            if model.allowed_writer_methods.include?(setter = "#{name}=")
              __send__(setter, value)
            else
              raise ArgumentError, "The attribute '#{name}' is not accessible in #{model}"
            end
          when Associations::Relationship, Property
            # only call a public #typecast (e.g. on Property instances)
            if name.respond_to?(:typecast)
              value = name.typecast(value)
            end
            self.persistence_state = persistence_state.set(name, value)
        end
      end
    end
879868
def attribute(*args)
      if args.first.is_a?(Hash)
        args.first.each_pair do |key, name|
          @attributes.add(name: name, attr: key)
        end
      else
        options = args.extract_options!
        args.each do |name|
          key = options[:as] || name
          @attributes.add(name: name, attr: key)
        end
      end
    end
404142
Rule FieldMacro() {
		return Sequence(String("m:"),
				ZeroOrMore(WSP()).suppressNode(),
				OneOrMore(FirstOf(WSP(), VCHAR()))
					.label("Macro").suppressSubnodes(),
				HeaderEol()
				).label(FieldMacro);
	}
494193
def field_attribute(attr)
      return 'id'           if attr == :_id
      # default, simply return name
      return attr           unless attr.is_a? Hash
      # else, Hash
      return attr[:object]  if attr.has_key? :object
      return attr[:array]   if attr.has_key? :array
      return attr[:value]   if attr.has_key? :value
      return attr[:link]    if attr.has_key? :link

      attr.keys[0]
    end
1328697
function (attr) {
            var value = typeof attr === 'string' && !! ~attr.indexOf('.') && this.__get(attr);
            if (value) {
                return value;
            }

            // break up the attr (`"foo.bar"`) into `["foo","bar"]`
            var parts = attrParts(attr),
                // get the value of the first attr name (`"foo"`)
                current = this.__get(parts.shift());
            // if there are other attributes to read
            return parts.length ?
            // and current has a value
            current ?
            // lookup the remaining attrs on current
            current._get(parts) :
            // or if there's no current, return undefined
            undefined :
            // if there are no more parts, return current
            current;
        }
1143209
def method_missing(name, *args, &block)
      if @type.has_attribute?(name.to_s)
        __attribute__(name, *args)
      else
        __tag__(name, *args, &block)
      end
    end
3135
def expansion_attribute(styles={})
      return nil if styles.nil?
      return nil if styles[:expansion].nil?
      value = styles[:expansion]
      return 0 if [0, :default].include?(value)
      return nil unless value.respond_to?(:to_f)
      return value.to_f
    end
146005
def attributes_assignments(list, wrapped = true, for_definition = false)
      if wrapped && lookahead(:exp_identifier_stripped_lookahead).nil? ||
         !wrapped && lookahead(:assignment_lookahead).nil?
        return list
      end

      return unless (argument = accept_stripped :node)

      argument = argument.to_sym

      if accept_stripped :assignment
        # Check if we have an attribute escape or not
        escaped = if accept :assignment_unescaped
                    false
                  else
                    true
                  end

        # Get the argument value if we have an assignment
        if (value = expression(false, wrapped))
          value[@options][:escaped] = escaped

          # IDs are unique, the rest of the attributes turn into arrays in
          # order to allow multiple values or identifiers
          add_attribute(list, argument, value)
        else
          Logger.error :parse, @code, @i, @j, :assignments_colon
        end
      else
        unless list[argument]
          default_value = for_definition ? 'nil' : 'true'
          list[argument] = [:expression, default_value, { escaped: false }]
        end
      end

      # If our attributes are wrapped, we allow method calls without
      # paranthesis, ruby style, therefore we need a terminator to signify
      # the expression end. If they are not wrapped (inline), we require
      # paranthesis and allow inline calls
      if wrapped
        # Accept optional comma between attributes
        accept_stripped :assignment_terminator

        # Lookahead for attributes on the current line and the next one
        if lookahead(:exp_identifier_stripped_lookahead)
          attributes_assignments list, wrapped, for_definition
        elsif lookahead_next_line(:exp_identifier_stripped_lookahead)
          accept_newline
          attributes_assignments list, wrapped, for_definition
        end
      elsif !wrapped && lookahead(:assignment_lookahead)
        attributes_assignments list, wrapped, for_definition
      end

      list
    end
127608
def attributes(*attributes)
      attributes.each do |attr|
        raise ArgumentError.new("You cannot use #{attr} as an attribute name since it is a reserved method name of Xapian::Document") if reserved_method_name?(attr)
        @attributes_hash[attr] = {}
        @type_map[attr] = :string
        self.index attr
      end
    end
1366131
def attributes
      fields.each_with_object(HashWithIndifferentAccess.new) do |field, acc|
        acc[field.alias] = field.value
      end
    end
1261387
def inspect
      attributes = to_h.map { |key, value| "#{key}=#{value.inspect}" }.join(', ')

      format(INSPECT_TEMPLATE, class_name: self.class.name, attributes: attributes)
    end
543203
def each_attribute
      
      #If we weren't passed a block, return an enumerator referencing this function.
      return enum_for(:each_attribute) unless block_given?

      #Yield each of the known attributes in turn.
      @xml.css("symbol attr").each do |attr|
        yield attr.attribute('name').value, attr.attribute('value').value
      end

    end