Class: Bunto::Assets::Liquid::Drop
- Inherits:
-
Liquid::Drop
- Object
- Liquid::Drop
- Bunto::Assets::Liquid::Drop
- Extended by:
- Forwardable
- Defined in:
- lib/bunto/assets/liquid/drop.rb
Instance Method Summary collapse
-
#basename ⇒ Object
——————————————————————–.
-
#dimensions ⇒ Object
——————————————————————–.
-
#height ⇒ Object
——————————————————————–.
-
#initialize(path, bunto) ⇒ Drop
constructor
A new instance of Drop.
-
#width ⇒ Object
——————————————————————–.
Constructor Details
#initialize(path, bunto) ⇒ Drop
Returns a new instance of Drop.
14 15 16 17 18 |
# File 'lib/bunto/assets/liquid/drop.rb', line 14 def initialize(path, bunto) @path = path @bunto = bunto @asset = nil end |
Instance Method Details
#basename ⇒ Object
30 31 32 |
# File 'lib/bunto/assets/liquid/drop.rb', line 30 def basename File.basename(@path) end |
#dimensions ⇒ Object
52 53 54 55 56 |
# File 'lib/bunto/assets/liquid/drop.rb', line 52 def dimensions if image? @dimensions ||= FastImage.new(asset.filename).size end end |
#height ⇒ Object
44 45 46 47 48 |
# File 'lib/bunto/assets/liquid/drop.rb', line 44 def height if image? dimensions.last end end |
#width ⇒ Object
36 37 38 39 40 |
# File 'lib/bunto/assets/liquid/drop.rb', line 36 def width if image? dimensions.first end end |