Class: EditableComponents::ItemFile

Inherits:
Item show all
Defined in:
app/models/editable_components/item_file.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Item

#attr_id, #class_name, item_types, #opt_input, #to_s, #update_data

Class Method Details

.type_nameObject



23
24
25
# File 'app/models/editable_components/item_file.rb', line 23

def self.type_name
  'file'
end

Instance Method Details

#editableObject



14
15
16
# File 'app/models/editable_components/item_file.rb', line 14

def editable
  Engine.edit_mode ? { 'data-ec-item': self.id, 'data-ec-input': self.opt_input, 'data-ec-type': self.class_name, 'data-ec-block': self.block_id } : {}
end

#initObject



18
19
20
21
# File 'app/models/editable_components/item_file.rb', line 18

def init
  self.data_file = File.open( EditableComponents::Engine.root.join( 'lib', 'data', 'img1.jpg' ) )
  self
end