Module: OllamaChat::Utils::Fetcher::HeaderExtension
- Defined in:
- lib/ollama_chat/utils/fetcher.rb
Instance Attribute Summary collapse
-
#content_type ⇒ String
The content_type method accesses the content type attribute of the object.
-
#ex ⇒ Object
The ex accessor is used to get or set the expiry value in seconds.
Class Method Summary collapse
-
.failed ⇒ StringIO
The failed method creates a StringIO object with a text/plain content type.
Instance Attribute Details
#content_type ⇒ String
The content_type method accesses the content type attribute of the object.
13 14 15 |
# File 'lib/ollama_chat/utils/fetcher.rb', line 13 def content_type @content_type end |
#ex ⇒ Object
The ex accessor is used to get or set the expiry value in seconds.
16 17 18 |
# File 'lib/ollama_chat/utils/fetcher.rb', line 16 def ex @ex end |
Class Method Details
.failed ⇒ StringIO
The failed method creates a StringIO object with a text/plain content type.
This method is used to generate a failed response object that can be used when an operation does not succeed. It initializes a new StringIO object and extends it with the current class, setting its content type to text/plain.
26 27 28 29 30 |
# File 'lib/ollama_chat/utils/fetcher.rb', line 26 def self.failed object = StringIO.new.extend(self) object.content_type = MIME::Types['text/plain'].first object end |