Class: Promethee::StructureUpgrader::Components::Base
- Inherits:
-
Object
- Object
- Promethee::StructureUpgrader::Components::Base
show all
- Defined in:
- app/services/promethee/structure_upgrader/components/base.rb
Direct Known Subclasses
Aside, Blockquote, Collection, CollectionItem, Column, Cover, Faq, FaqItem, Image, Page, Row, Slider, SliderItem, Table, TableCell, Text, Video
Instance Method Summary
collapse
Constructor Details
#initialize(data) ⇒ Base
Returns a new instance of Base.
3
4
5
6
7
8
|
# File 'app/services/promethee/structure_upgrader/components/base.rb', line 3
def initialize(data)
@data = data
upgrade
end
|
Instance Method Details
#upgrade ⇒ Object
14
15
16
17
18
19
20
|
# File 'app/services/promethee/structure_upgrader/components/base.rb', line 14
def upgrade
@upgraded_data = @data.deep_dup
@upgraded_data['attributes'] ||= {}
return if @upgraded_data['attributes'].empty?
@upgraded_data['attributes'] = upgraded_attributes.deep_stringify_keys
end
|
#upgraded_attributes ⇒ Object
22
23
24
|
# File 'app/services/promethee/structure_upgrader/components/base.rb', line 22
def upgraded_attributes
raise NotImplementedError
end
|
#upgraded_data ⇒ Object
10
11
12
|
# File 'app/services/promethee/structure_upgrader/components/base.rb', line 10
def upgraded_data
@upgraded_data
end
|