Class: JSONdb::Constants

Inherits:
Object
  • Object
show all
Defined in:
lib/jsondb/constants.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConstants

Returns a new instance of Constants.



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/jsondb/constants.rb', line 7

def initialize
  @default_file_content = {
      'db'      => "{ \"tables\": {}, \"db\": { \"created_at\": #{Time.now.to_i}, \"updated_at\": #{Time.now.to_i} } }",
      'table'   => '{ }',
      'log'     => '',
      'raw'     => ''
    }
  @loglevels = {
    debug: 1, 
    info:  2, 
    error: 3 
  }
end

Instance Attribute Details

#default_file_contentObject (readonly)

Returns the value of attribute default_file_content.



5
6
7
# File 'lib/jsondb/constants.rb', line 5

def default_file_content
  @default_file_content
end

#loglevelsObject (readonly)

Returns the value of attribute loglevels.



5
6
7
# File 'lib/jsondb/constants.rb', line 5

def loglevels
  @loglevels
end