Class: Locomotive::ContentAssetPresenter
Instance Attribute Summary
#ability, #depth
Instance Method Summary
collapse
#ability?, #after_initialize, getters_to_hash, #id, setters_to_hash, #site
#after_initialize, #as_json, #attributes=, #getters, #initialize, #property_options, #setters
Instance Method Details
#content_type ⇒ Object
6
|
# File 'app/presenters/locomotive/content_asset_presenter.rb', line 6
properties :content_type, :width, :height
|
#content_type_text ⇒ Object
33
34
35
36
|
# File 'app/presenters/locomotive/content_asset_presenter.rb', line 33
def content_type_text
value = self.source.content_type.to_s == 'other' ? self.extname : self.source.content_type
value.blank? ? '?' : value
end
|
#extname ⇒ Object
29
30
31
|
# File 'app/presenters/locomotive/content_asset_presenter.rb', line 29
def extname
truncate(self.source.extname, :length => 3)
end
|
#filename ⇒ Object
21
22
23
|
# File 'app/presenters/locomotive/content_asset_presenter.rb', line 21
def filename
truncate(self.source.source_filename, :length => 22)
end
|
#full_filename ⇒ Object
custom getters / setters ##
17
18
19
|
# File 'app/presenters/locomotive/content_asset_presenter.rb', line 17
def full_filename
self.source.source_filename
end
|
#short_name ⇒ Object
25
26
27
|
# File 'app/presenters/locomotive/content_asset_presenter.rb', line 25
def short_name
truncate(self.source.name, :length => 15)
end
|
#url ⇒ Object
38
39
40
|
# File 'app/presenters/locomotive/content_asset_presenter.rb', line 38
def url
self.source.source.url
end
|