Class: Lookbook::DataUriEncoder
- Defined in:
- lib/lookbook/services/urls/data_uri_encoder.rb
Instance Attribute Summary collapse
- #mime_type ⇒ Object readonly
- #str ⇒ Object readonly
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(str, mime_type) ⇒ DataUriEncoder
constructor
A new instance of DataUriEncoder.
Methods inherited from Service
Constructor Details
#initialize(str, mime_type) ⇒ DataUriEncoder
Returns a new instance of DataUriEncoder.
5 6 7 8 |
# File 'lib/lookbook/services/urls/data_uri_encoder.rb', line 5 def initialize(str, mime_type) @str = str @mime_type = mime_type end |
Instance Attribute Details
#mime_type ⇒ Object (readonly)
3 4 5 |
# File 'lib/lookbook/services/urls/data_uri_encoder.rb', line 3 def mime_type @mime_type end |
#str ⇒ Object (readonly)
3 4 5 |
# File 'lib/lookbook/services/urls/data_uri_encoder.rb', line 3 def str @str end |
Instance Method Details
#call ⇒ Object
10 11 12 |
# File 'lib/lookbook/services/urls/data_uri_encoder.rb', line 10 def call "data:#{mime_type},#{ERB::Util.url_encode(str)}" end |