Class: Paperclip::DataUriAdapter
- Inherits:
-
StringioAdapter
- Object
- AbstractAdapter
- StringioAdapter
- Paperclip::DataUriAdapter
- Defined in:
- lib/paperclip/io_adapters/data_uri_adapter.rb
Constant Summary collapse
- REGEXP =
/\Adata:([-\w]+\/[-\w\+\.]+)?;base64,(.*)/m.freeze
Constants inherited from AbstractAdapter
AbstractAdapter::OS_RESTRICTED_CHARACTERS
Instance Attribute Summary
Attributes inherited from StringioAdapter
Attributes inherited from AbstractAdapter
#content_type, #original_filename, #size, #tempfile
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(target_uri, options = {}) ⇒ DataUriAdapter
constructor
A new instance of DataUriAdapter.
Methods inherited from AbstractAdapter
#assignment?, #fingerprint, #inspect, #nil?, #read
Constructor Details
#initialize(target_uri, options = {}) ⇒ DataUriAdapter
Returns a new instance of DataUriAdapter.
11 12 13 |
# File 'lib/paperclip/io_adapters/data_uri_adapter.rb', line 11 def initialize(target_uri, = {}) super(extract_target(target_uri), ) end |
Class Method Details
.register ⇒ Object
3 4 5 6 7 |
# File 'lib/paperclip/io_adapters/data_uri_adapter.rb', line 3 def self.register Paperclip.io_adapters.register self do |target| String === target && target =~ REGEXP end end |