Class: Mindee::Parsing::V2::InferenceFile
- Inherits:
-
Object
- Object
- Mindee::Parsing::V2::InferenceFile
- Defined in:
- lib/mindee/parsing/v2/inference_file.rb
Overview
Information about a file returned in an inference.
Instance Attribute Summary collapse
-
#file_alias ⇒ String?
readonly
Optional alias for the file.
-
#mime_type ⇒ String
readonly
MIME type.
-
#name ⇒ String
readonly
File name.
-
#page_count ⇒ Integer
readonly
Page count.
Instance Method Summary collapse
-
#initialize(server_response) ⇒ InferenceFile
constructor
A new instance of InferenceFile.
-
#to_s ⇒ String
String representation.
Constructor Details
#initialize(server_response) ⇒ InferenceFile
Returns a new instance of InferenceFile.
18 19 20 21 22 23 |
# File 'lib/mindee/parsing/v2/inference_file.rb', line 18 def initialize(server_response) @name = server_response['name'] @file_alias = server_response['alias'] @page_count = server_response['page_count'] @mime_type = server_response['mime_type'] end |
Instance Attribute Details
#file_alias ⇒ String? (readonly)
Returns Optional alias for the file.
11 12 13 |
# File 'lib/mindee/parsing/v2/inference_file.rb', line 11 def file_alias @file_alias end |
#mime_type ⇒ String (readonly)
Returns MIME type.
15 16 17 |
# File 'lib/mindee/parsing/v2/inference_file.rb', line 15 def mime_type @mime_type end |
#name ⇒ String (readonly)
Returns File name.
9 10 11 |
# File 'lib/mindee/parsing/v2/inference_file.rb', line 9 def name @name end |
#page_count ⇒ Integer (readonly)
Returns Page count.
13 14 15 |
# File 'lib/mindee/parsing/v2/inference_file.rb', line 13 def page_count @page_count end |
Instance Method Details
#to_s ⇒ String
String representation.
27 28 29 30 31 32 33 34 |
# File 'lib/mindee/parsing/v2/inference_file.rb', line 27 def to_s "File\n" \ "====\n" \ ":Name: #{@name}\n" \ ":Alias:#{" #{@file_alias}" if @file_alias}\n" \ ":Page Count: #{@page_count}\n" \ ":MIME Type: #{@mime_type}\n" end |