Class: Correios::Setup

Inherits:
Object
  • Object
show all
Defined in:
lib/ceps/setup.rb

Overview

Handles building the in memory store of CEP data

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#data_fileObject



27
28
29
# File 'lib/ceps/setup.rb', line 27

def data_file
  @data_file || File.join(data_file_path, data_file_name)
end

#data_file_nameObject



19
20
21
# File 'lib/ceps/setup.rb', line 19

def data_file_name
  @data_file_name || "ceps.yaml"
end

#data_file_pathObject



23
24
25
# File 'lib/ceps/setup.rb', line 23

def data_file_path
  @data_file_path || default_file_path
end

Instance Method Details

#cepsObject



14
15
16
17
# File 'lib/ceps/setup.rb', line 14

def ceps
  return @ceps if instance_variable_defined?("@ceps")
  @ceps ||= load
end