Class: Promethee::StructureUpgrader::Components::Base

Inherits:
Object
  • Object
show all
Defined in:
app/services/promethee/structure_upgrader/components/base.rb

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
  # puts "<#{self.class}> Initialized."

  upgrade
end

Instance Method Details

#upgradeObject



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_attributesObject

Raises:

  • (NotImplementedError)


22
23
24
# File 'app/services/promethee/structure_upgrader/components/base.rb', line 22

def upgraded_attributes
  raise NotImplementedError
end

#upgraded_dataObject



10
11
12
# File 'app/services/promethee/structure_upgrader/components/base.rb', line 10

def upgraded_data
  @upgraded_data
end