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



15
16
17
18
19
20
21
# File 'lib/unified2/config_file.rb', line 15

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.



7
8
9
# File 'lib/unified2/config_file.rb', line 7

def data
  @data
end

#md5Object

Returns the value of attribute md5.



7
8
9
# File 'lib/unified2/config_file.rb', line 7

def md5
  @md5
end

#pathObject

Returns the value of attribute path.



7
8
9
# File 'lib/unified2/config_file.rb', line 7

def path
  @path
end

#typeObject

Returns the value of attribute type.



7
8
9
# File 'lib/unified2/config_file.rb', line 7

def type
  @type
end

Instance Method Details

#sizeInteger

Size

Returns:

  • (Integer)

    Configuration size



28
29
30
# File 'lib/unified2/config_file.rb', line 28

def size
  @data.size
end