Module: BuddiesAvatar::ORM::Base

Extended by:
ActiveSupport::Concern
Defined in:
lib/buddies_avatar/orm/base.rb

Instance Method Summary collapse

Instance Method Details

#avatar_geometryObject



20
21
22
23
# File 'lib/buddies_avatar/orm/base.rb', line 20

def avatar_geometry
  img = MiniMagick::Image.open avatar_upload_path
  @geometry = { width: img[:width], height: img[:height] }
end

#crop_stringObject



16
17
18
# File 'lib/buddies_avatar/orm/base.rb', line 16

def crop_string
  "#{crop_w}x#{crop_h}+#{crop_x}+#{crop_y}"
end

#cropping?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/buddies_avatar/orm/base.rb', line 12

def cropping?
  !crop_x.blank? && !crop_y.blank? && !crop_w.blank? && !crop_h.blank?
end