Class: Gecko::Record::Image
Constant Summary collapse
- AVAILABLE_SIZES =
[:full, :thumbnail]
Instance Method Summary collapse
-
#url(size = :full) ⇒ String
URL for image.
Methods inherited from Base
demodulized_name, #initialize, #persisted?, #save
Methods included from Helpers::AssociationHelper
Methods included from Helpers::ValidationHelper
Methods included from Helpers::SerializationHelper
#_serialize, #as_json, #root, #serializable_hash, #serialize_attribute
Methods included from Helpers::InspectionHelper
Constructor Details
This class inherits a constructor from Gecko::Record::Base
Instance Method Details
#url(size = :full) ⇒ String
URL for image
25 26 27 28 29 30 31 32 |
# File 'lib/gecko/record/image.rb', line 25 def url(size = :full) if size == :full file_path = file_name else file_path = "#{size}_#{file_name}" end [base_path, file_path].join("/") end |