Class: Imgry::Processor::Adapter
- Inherits:
-
Object
- Object
- Imgry::Processor::Adapter
- Defined in:
- lib/imgry/processor.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#format ⇒ Object
Returns the value of attribute format.
-
#img ⇒ Object
Returns the value of attribute img.
-
#img_blob ⇒ Object
Returns the value of attribute img_blob.
Class Method Summary collapse
Instance Method Summary collapse
- #aspect_ratio ⇒ Object
-
#initialize(img_blob) ⇒ Adapter
constructor
A new instance of Adapter.
- #inspect ⇒ Object
- #load_image! ⇒ Object
Constructor Details
#initialize(img_blob) ⇒ Adapter
Returns a new instance of Adapter.
18 19 20 21 22 23 |
# File 'lib/imgry/processor.rb', line 18 def initialize(img_blob) @img_blob = img_blob @format = nil @img = nil load_image! end |
Instance Attribute Details
#format ⇒ Object
Returns the value of attribute format.
16 17 18 |
# File 'lib/imgry/processor.rb', line 16 def format @format end |
#img ⇒ Object
Returns the value of attribute img.
16 17 18 |
# File 'lib/imgry/processor.rb', line 16 def img @img end |
#img_blob ⇒ Object
Returns the value of attribute img_blob.
16 17 18 |
# File 'lib/imgry/processor.rb', line 16 def img_blob @img_blob end |
Class Method Details
.from_file(path) ⇒ Object
12 13 14 |
# File 'lib/imgry/processor.rb', line 12 def self.from_file(path) # Abstract end |
.load_lib! ⇒ Object
5 6 |
# File 'lib/imgry/processor.rb', line 5 def self.load_lib! end |
.with_bytes(img_bytes) ⇒ Object
8 9 10 |
# File 'lib/imgry/processor.rb', line 8 def self.with_bytes(img_bytes) # Abstract end |
Instance Method Details
#aspect_ratio ⇒ Object
37 38 39 |
# File 'lib/imgry/processor.rb', line 37 def aspect_ratio width.to_f / height.to_f end |
#inspect ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/imgry/processor.rb', line 25 def inspect if @format "#<#{self.class} format: #{@format}>" else "#<#{self.class}>" end end |
#load_image! ⇒ Object
33 34 35 |
# File 'lib/imgry/processor.rb', line 33 def load_image! # Abstract end |