123456789_123456789_123456789_123456789_123456789_

Class: Puma::StateFile

Relationships & Source Files
Inherits: Object
Defined in: lib/puma/state_file.rb

Constant Summary

Class Method Summary

Instance Method Summary

Constructor Details

.newStateFile

[ GitHub ]

  
# File 'lib/puma/state_file.rb', line 7

def initialize
  @options = {}
end

Instance Method Details

#load(path)

[ GitHub ]

  
# File 'lib/puma/state_file.rb', line 18

def load(path)
  @options = YAML.load File.read(path)
end

#save(path, permission = nil)

[ GitHub ]

  
# File 'lib/puma/state_file.rb', line 11

def save(path, permission = nil)
  File.open(path, "w") do |file|
    file.chmod(permission) if permission
    file.write(YAML.dump(@options))
  end
end