Class: Banner

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/banner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#crop_hObject

Returns the value of attribute crop_h.



19
20
21
# File 'app/models/banner.rb', line 19

def crop_h
  @crop_h
end

#crop_wObject

Returns the value of attribute crop_w.



19
20
21
# File 'app/models/banner.rb', line 19

def crop_w
  @crop_w
end

#crop_xObject

Returns the value of attribute crop_x.



19
20
21
# File 'app/models/banner.rb', line 19

def crop_x
  @crop_x
end

#crop_yObject

Returns the value of attribute crop_y.



19
20
21
# File 'app/models/banner.rb', line 19

def crop_y
  @crop_y
end

Instance Method Details

#arquivo_geometry(style = :original) ⇒ Object



28
29
30
31
# File 'app/models/banner.rb', line 28

def arquivo_geometry(style = :original)  
  @geometry ||= {}  
  @geometry[style] ||= Paperclip::Geometry.from_file(arquivo.path(style))  
end

#cropping?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'app/models/banner.rb', line 24

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