Returns all the textual metadata key/value pairs as hash.
 @return [Hash] A hash containing metadata fields and their values.
507936
def metadata
      metadata = {}
      other_chunks.each do |chunk|
        metadata[chunk.keyword] = chunk.value if chunk.respond_to?(:keyword) && chunk.respond_to?(:value)
      end
      metadata
    end
1368523
def to_hash
      field_hash = {@tag=>{'ind1'=>@indicator1,'ind2'=>@indicator2,'subfields'=>[]}}
      self.each do |subfield|
        field_hash[@tag]['subfields'] << {subfield.code=>subfield.value}
      end
      field_hash
    end
746000
def pack_metadata(self) -> List[Tuple[str, Any]]:
        
        metadata = [(k, v) for k, v in self._invocation_metadata.items()
                    if k != LOG_FIELDS_KEY_META]
        metadata.append((LOG_FIELDS_KEY_META, self._log_fields.dumps()))
        return metadata
771377
def to_hash
      hash = {}
      hash["attrs"] = @attrs

      self.instance_variables.keep_if { |key| key != :@attrs }.each do |var|
        val = self.instance_variable_get(var)
        hash["attrs"][var.to_s.delete("@").to_sym] = val.to_hash if val.is_a? ACTV::Base
      end

      hash["attrs"]
    end
596836
def to_hash
      hash = {}
      self.class.attribute_map.each_pair do |attr, param|
        value = self.send(attr)
        next if value.nil?
        hash[param] = _to_hash(value)
      end
      hash
    end
1279289
def keys(self):
        
        try:
            return self._metadata["fields"]
        except KeyError:
            if self.attached():
                self._session.send()
            while self.attached() and "fields" not in self._metadata:
                self._session.fetch()
            return self._metadata.get("fields")
484275
def to_hash
      doc = ::Nokogiri::XML( self.response )
      hash = {}
      doc.at_css("Response").element_children.each do |attribute|
        hash[attribute.name.underscore.to_sym] = attribute.inner_text
      end
      hash[:valid] = doc.at_css("Response")['valid']
      hash
    end
1135188
def to_dot_attributes(hash)
      # TODO: fix uncompatible key names
      # TODO: some values must be encoded (backquoting and the like)
      buffer = ""
      hash.each_pair do |k,v|
        buffer << " " unless buffer.empty?
        v = case v
          when Array
            if v.all?{|elm| Array===elm and elm.length==2 and elm.all?{|subelm| Numeric===subelm}}
              v.inject('') {|memo, elm| "#{memo} #{elm.join(',')}"}.strip
            else
              v.join(', ')
            end
          else
            v.to_s
        end
        buffer << "#{k}=\"#{v}\""
      end
      buffer
    end
215612
def to_hash
      {}.tap do |hash|
        _attributes.each do |key, value|
          hash[key] = value.respond_to?(:to_hash) ? value.to_hash : value
        end
      end
    end
198116
def to_hash_with_values
      keys = table_header_keys
      values = self
      @hash_with_values = {}
      keys.each_with_index {|k,i| v=values[i]; v=v.value if v; @hash_with_values[k]=v}
      return @hash_with_values
    end
1009516
def serialize_attributes
    attr_hash = {}
    @attributes.each_pair do |name,value|
      attr_hash[name] = serialize_attribute(name,value)
    end
    attr_hash[:id] = serialize_id unless new?
    attr_hash
  end
1079151
def to_hash(val)
      if @options[:humidity] then
        return {"humidity" => val.humidity}
      end

      if @options[:unit] == :c then
        if @options[:temperature] then
          return {"temperature" => val.temp}
        else
          return {"temperature" => val.temp, "humidity" => val.humidity}
        end
      else
        if @options[:temperature] then
          return {"temperature" => val.temp_f}
        else
          return {"temperature" => val.temp_f, "humidity" => val.humidity}
        end
      end
    end
725201
def to_hash
      {}.merge(@properties).tap do |h|
        h['_links'] = {}.merge @links    unless @links.empty?

        combined_embedded = {}
        combined_embedded.merge! @embedded unless @embedded.empty?
        combined_embedded.merge! @embedded_arrays unless @embedded_arrays.empty?
        h['_embedded'] = combined_embedded unless combined_embedded.empty?
      end
    end
457234
def to_hash
            index_hash = {}
            index_hash['json_claz'] = self.class.name
            index_hash['id'] = id
            index_hash["asms_id"] = asms_id
            index_hash['name'] = name
            index_hash['components'] = components
            index_hash['tosca_type'] = tosca_type
            index_hash['policies'] = policies
            index_hash['inputs'] = inputs
            index_hash['outputs'] = outputs
            index_hash['status'] = status
            index_hash['state'] = state
            index_hash['created_at'] = created_at
            index_hash
        end
305068
def _parse_metadatas(self, text_lines):
        
        if not text_lines:
            return {}
        expr_metadata = re.compile(r'^#\+([a-zA-Z]+):(.*)')
        return {
            expr_metadata.match(line).group(1).lower()
            : expr_metadata.match(line).group(2).strip()
            for line in text_lines
        }
588156
def metadata
      {:definitions => representer_attrs.grep(Definition).map {|definition| definition.name},
       :links => representer_attrs.grep(Link).map {|link| link.options[:as] ? {link.rel => {'as' => link.options[:as]}} : link.rel}
      }
    end
672380
def hashtags_erb
      retdict = {
        enabled: @config[:hashtags][:enabled],
        top: [],
        nottop: []
      }

      if @config[:hashtags][:enabled]
        top = @parsed[:hashtags].slice(0, @config[:hashtags][:top]) # top X hashtags
        top.each do |hashtag|
          retdict[:top] << hashtag[1]
        end

        nottop = @parsed[:hashtags].slice(@config[:hashtags][:top], @config[:hashtags][:notop]) # not in the top X
        unless nottop.nil?
          nottop.each do |hashtag|
            hashtag[1].delete(:example)
            retdict[:nottop] << hashtag[1]
          end
        end
      end

      retdict
    end