Class: NitroIntelligence::Media
- Inherits:
-
Object
- Object
- NitroIntelligence::Media
- Defined in:
- lib/nitro_intelligence/media/media.rb
Instance Attribute Summary collapse
-
#base64 ⇒ Object
readonly
Returns the value of attribute base64.
-
#byte_string ⇒ Object
readonly
Returns the value of attribute byte_string.
-
#direction ⇒ Object
Returns the value of attribute direction.
-
#file_extension ⇒ Object
readonly
Returns the value of attribute file_extension.
-
#file_type ⇒ Object
readonly
Returns the value of attribute file_type.
-
#mime_type ⇒ Object
readonly
Returns the value of attribute mime_type.
-
#reference_id ⇒ Object
Returns the value of attribute reference_id.
Instance Method Summary collapse
-
#initialize(file) ⇒ Media
constructor
Input should be byte string.
Constructor Details
#initialize(file) ⇒ Media
Input should be byte string. e.g. File.binread(‘file.ext’)
9 10 11 12 13 14 15 16 17 |
# File 'lib/nitro_intelligence/media/media.rb', line 9 def initialize(file) @base64 = Base64.strict_encode64(file) @byte_string = file @direction = "input" @file_extension = nil @file_type = nil @mime_type = nil @reference_id = nil end |
Instance Attribute Details
#base64 ⇒ Object (readonly)
Returns the value of attribute base64.
6 7 8 |
# File 'lib/nitro_intelligence/media/media.rb', line 6 def base64 @base64 end |
#byte_string ⇒ Object (readonly)
Returns the value of attribute byte_string.
6 7 8 |
# File 'lib/nitro_intelligence/media/media.rb', line 6 def byte_string @byte_string end |
#direction ⇒ Object
Returns the value of attribute direction.
5 6 7 |
# File 'lib/nitro_intelligence/media/media.rb', line 5 def direction @direction end |
#file_extension ⇒ Object (readonly)
Returns the value of attribute file_extension.
6 7 8 |
# File 'lib/nitro_intelligence/media/media.rb', line 6 def file_extension @file_extension end |
#file_type ⇒ Object (readonly)
Returns the value of attribute file_type.
6 7 8 |
# File 'lib/nitro_intelligence/media/media.rb', line 6 def file_type @file_type end |
#mime_type ⇒ Object (readonly)
Returns the value of attribute mime_type.
6 7 8 |
# File 'lib/nitro_intelligence/media/media.rb', line 6 def mime_type @mime_type end |
#reference_id ⇒ Object
Returns the value of attribute reference_id.
5 6 7 |
# File 'lib/nitro_intelligence/media/media.rb', line 5 def reference_id @reference_id end |