Class: Bunto::Assets::Liquid::Drop

Inherits:
Liquid::Drop
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/bunto/assets/liquid/drop.rb

Instance Method Summary collapse

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

#basenameObject




30
31
32
# File 'lib/bunto/assets/liquid/drop.rb', line 30

def basename
  File.basename(@path)
end

#dimensionsObject




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

#heightObject




44
45
46
47
48
# File 'lib/bunto/assets/liquid/drop.rb', line 44

def height
  if image?
    dimensions.last
  end
end

#widthObject




36
37
38
39
40
# File 'lib/bunto/assets/liquid/drop.rb', line 36

def width
  if image?
    dimensions.first
  end
end