Class: LLM::URIData

Inherits:
Struct
  • Object
show all
Defined in:
lib/llm/uridata.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#content_typeObject

Returns the value of attribute content_type

Returns:

  • (Object)

    the current value of content_type



4
5
6
# File 'lib/llm/uridata.rb', line 4

def content_type
  @content_type
end

#decodedObject

Returns the value of attribute decoded

Returns:

  • (Object)

    the current value of decoded



4
5
6
# File 'lib/llm/uridata.rb', line 4

def decoded
  @decoded
end

#encodedObject

Returns the value of attribute encoded

Returns:

  • (Object)

    the current value of encoded



4
5
6
# File 'lib/llm/uridata.rb', line 4

def encoded
  @encoded
end

#encoding_typeObject

Returns the value of attribute encoding_type

Returns:

  • (Object)

    the current value of encoding_type



4
5
6
# File 'lib/llm/uridata.rb', line 4

def encoding_type
  @encoding_type
end

Class Method Details

.parse(str) ⇒ URIData

Parameters:

  • str (String)

    A string

Returns:



9
10
11
12
13
14
# File 'lib/llm/uridata.rb', line 9

def self.parse(str)
  _, data = str.split(":")
  content_type, data = data.split(";")
  encoding_type, data = data.split(",")
  URIData.new(content_type, encoding_type, data, StringIO.new(data.unpack1("m0")))
end