Class: Unified2::ConfigFile

Inherits:
Object
  • Object
show all
Defined in:
lib/unified2/config_file.rb

Overview

Configuration file

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, path) ⇒ ConfigFile

Initialize configuration file

Parameters:

  • type (String, Symbol)

    Configuration file type

  • path (String)

    Configuration file path



18
19
20
21
22
23
24
# File 'lib/unified2/config_file.rb', line 18

def initialize(type, path)
  @type = type
  @path = path
  @data = {}
  @md5 = Digest::MD5.hexdigest(@path)
  import
end

Instance Attribute Details

#dataObject

Returns the value of attribute data.



10
11
12
# File 'lib/unified2/config_file.rb', line 10

def data
  @data
end

#md5Object

Returns the value of attribute md5.



10
11
12
# File 'lib/unified2/config_file.rb', line 10

def md5
  @md5
end

#pathObject

Returns the value of attribute path.



10
11
12
# File 'lib/unified2/config_file.rb', line 10

def path
  @path
end

#typeObject

Returns the value of attribute type.



10
11
12
# File 'lib/unified2/config_file.rb', line 10

def type
  @type
end

Instance Method Details

#sizeInteger

Size

Returns:

  • (Integer)

    Configuration size



31
32
33
# File 'lib/unified2/config_file.rb', line 31

def size
  @data.size
end