Class: Yoti::Media
- Inherits:
-
Object
- Object
- Yoti::Media
- Defined in:
- lib/yoti/data_type/media.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#mime_type ⇒ Object
readonly
Returns the value of attribute mime_type.
Instance Method Summary collapse
- #base64_content ⇒ Object
-
#initialize(content, mime_type) ⇒ Media
constructor
A new instance of Media.
Constructor Details
#initialize(content, mime_type) ⇒ Media
Returns a new instance of Media.
10 11 12 13 |
# File 'lib/yoti/data_type/media.rb', line 10 def initialize(content, mime_type) @content = content @mime_type = mime_type end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
7 8 9 |
# File 'lib/yoti/data_type/media.rb', line 7 def content @content end |
#mime_type ⇒ Object (readonly)
Returns the value of attribute mime_type.
8 9 10 |
# File 'lib/yoti/data_type/media.rb', line 8 def mime_type @mime_type end |
Instance Method Details
#base64_content ⇒ Object
15 16 17 |
# File 'lib/yoti/data_type/media.rb', line 15 def base64_content "data:#{mime_type};base64,#{Base64.strict_encode64(content)}" end |