Class: Backup::LoadFromFiles::DataFile

Inherits:
Object
  • Object
show all
Defined in:
lib/backup/load_from_files.rb

Direct Known Subclasses

EntryFile, RelationshipFile

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json_content) ⇒ DataFile

Returns a new instance of DataFile.



16
17
18
# File 'lib/backup/load_from_files.rb', line 16

def initialize(json_content)
  @content = json_content
end

Instance Attribute Details

#contentObject

Returns the value of attribute content.



14
15
16
# File 'lib/backup/load_from_files.rb', line 14

def content
  @content
end

Instance Method Details

#full_hashObject



28
29
30
# File 'lib/backup/load_from_files.rb', line 28

def full_hash
  @content.hash
end

#table_nameObject



20
21
22
# File 'lib/backup/load_from_files.rb', line 20

def table_name
  @content.match(/"table_name":\s?"(\w+)"/)[1]
end

#table_name_symObject



24
25
26
# File 'lib/backup/load_from_files.rb', line 24

def table_name_sym
  table_name.to_sym
end