Class: Rucoa::DefinitionArchiver

Inherits:
Object
  • Object
show all
Defined in:
lib/rucoa/definition_archiver.rb

Class Method Summary collapse

Class Method Details

.dump(definitions) ⇒ void

This method returns an undefined value.

Parameters:

  • definitions (Array<Rucoa::Definition::Base>)


13
14
15
16
17
18
19
# File 'lib/rucoa/definition_archiver.rb', line 13

def dump(definitions)
  pathname = ::Pathname.new(RUBY_DEFINITIONS_DUMP_PATH)
  pathname.parent.mkpath
  pathname.write(
    ::Marshal.dump(definitions)
  )
end

.loadArray<Rucoa::Definition::Base>

Returns:

  • (Array<Rucoa::Definition::Base>)


22
23
24
25
26
# File 'lib/rucoa/definition_archiver.rb', line 22

def load
  ::Marshal.load(
    ::File.binread(RUBY_DEFINITIONS_DUMP_PATH)
  )
end