public Method

Property.load(stream)

There's no documentation for this item.

Source Code

# File soap/property.rb, line 71
def load(stream)
  key_prefix = ""
  stream.each_with_index do |line, lineno|
    line.sub!(/\r?\n\z/, '')
    case line
    when COMMENT_REGEXP
      next
    when CATDEF_REGEXP
      key_prefix = $1.strip
    when LINE_REGEXP
      key, value = $1.strip, $2.strip
      key = "#{key_prefix}.#{key}" unless key_prefix.empty?
      key, value = loadstr(key), loadstr(value)
      self[key] = value
    else
      raise TypeError.new(
        "property format error at line #{lineno + 1}: `#{line}'")
    end
  end
  self
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.