Class: ContentsCore::ItemArray
- Inherits:
-
Item
show all
- Defined in:
- app/models/contents_core/item_array.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Item
#as_json, #attr_id, #class_name, #editable, item_types, #opt_input, #set, #update_data
Class Method Details
.permitted_attributes ⇒ Object
20
21
22
|
# File 'app/models/contents_core/item_array.rb', line 20
def self.permitted_attributes
[:data_string, :data_hash]
end
|
.type_name ⇒ Object
24
25
26
|
# File 'app/models/contents_core/item_array.rb', line 24
def self.type_name
'array'
end
|
Instance Method Details
#enum ⇒ Object
7
8
9
|
# File 'app/models/contents_core/item_array.rb', line 7
def enum
config[:values] ? config[:values] : ( config[:values_method] ? config[:values_method].call : self.data_hash )
end
|
#init ⇒ Object
11
12
13
14
|
# File 'app/models/contents_core/item_array.rb', line 11
def init
self.data = ''
self
end
|
#to_s ⇒ Object
16
17
18
|
# File 'app/models/contents_core/item_array.rb', line 16
def to_s
self.data
end
|