Class: Locomotive::EditableFilePresenter

Inherits:
EditableElementPresenter show all
Defined in:
app/presenters/locomotive/editable_file_presenter.rb

Instance Attribute Summary

Attributes inherited from BasePresenter

#ability, #depth

Instance Method Summary collapse

Methods inherited from EditableElementPresenter

#block_name, #label, #slug, #type

Methods inherited from BasePresenter

#ability?, #after_initialize, getters_to_hash, #id, setters_to_hash, #site

Methods included from Presentable

#after_initialize, #as_json, #attributes=, #getters, #initialize, #property_options, #setters

Instance Method Details

#contentObject

properties ##



6
# File 'app/presenters/locomotive/editable_file_presenter.rb', line 6

property    :content

#filenameObject

other getters / setters ##



12
13
14
# File 'app/presenters/locomotive/editable_file_presenter.rb', line 12

def filename
  File.basename(self.content)
end

#source=(value) ⇒ Object



20
21
22
# File 'app/presenters/locomotive/editable_file_presenter.rb', line 20

def source=(value)
  self.source.source = value
end

#source_url=(url) ⇒ Object



24
25
26
# File 'app/presenters/locomotive/editable_file_presenter.rb', line 24

def source_url=(url)
  self.source.remote_source_url = url
end

#urlObject



16
17
18
# File 'app/presenters/locomotive/editable_file_presenter.rb', line 16

def url
  self.content
end