Class: Locomotive::Steam::ContentEntry::FileField
- Inherits:
-
Object
- Object
- Locomotive::Steam::ContentEntry::FileField
- Defined in:
- lib/locomotive/steam/entities/content_entry.rb
Overview
Represent a file
Instance Method Summary collapse
Instance Method Details
#to_hash ⇒ Object
238 239 240 |
# File 'lib/locomotive/steam/entities/content_entry.rb', line 238 def to_hash { 'url' => url, 'filename' => filename, 'size' => size, 'updated_at' => updated_at } end |
#to_json ⇒ Object
242 243 244 |
# File 'lib/locomotive/steam/entities/content_entry.rb', line 242 def to_json url end |
#to_liquid ⇒ Object
246 247 248 |
# File 'lib/locomotive/steam/entities/content_entry.rb', line 246 def to_liquid Locomotive::Steam::Liquid::Drops::UploadedFile.new(self) end |
#url ⇒ Object
233 234 235 236 |
# File 'lib/locomotive/steam/entities/content_entry.rb', line 233 def url return if filename.blank? base.blank? ? filename : "#{base}/#{filename}" end |