Class: Poleica::Converters::Coercive
- Inherits:
-
Object
- Object
- Poleica::Converters::Coercive
- Includes:
- Utils
- Defined in:
- lib/poleica/converters/coercive.rb
Overview
The Coercive converter, it tries to coerce the polei
Constant Summary collapse
- COMPATIBLE_TYPES =
[ Types::All ]
- TYPE_RETURNED_BY_METHOD =
TODO: Think about another way of declare return types
{ to_pdf: Types::PDF, to_png: Types::Image, to_thumbnail: Types::Image }
Instance Attribute Summary collapse
-
#polei ⇒ Object
readonly
Returns the value of attribute polei.
Instance Method Summary collapse
-
#initialize(polei) ⇒ Coercive
constructor
A new instance of Coercive.
Methods included from Utils
#bin_path, exec_with_timeout, extract_extension_and_options, fail_if_error, #host_os, init_process_std, #linux?, map_std, #osx?, #underscorize, #windows?
Constructor Details
#initialize(polei) ⇒ Coercive
Returns a new instance of Coercive.
21 22 23 |
# File 'lib/poleica/converters/coercive.rb', line 21 def initialize(polei) @polei = polei end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object (private)
27 28 29 30 31 |
# File 'lib/poleica/converters/coercive.rb', line 27 def method_missing(method, *args, &block) extension, = Utils.(method, args) return try_convert(method, ) if extension super end |
Instance Attribute Details
#polei ⇒ Object (readonly)
Returns the value of attribute polei.
19 20 21 |
# File 'lib/poleica/converters/coercive.rb', line 19 def polei @polei end |