Class: OptParseValidator::ConfigFilesLoaderMerger::ConfigFile::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/opt_parse_validator/config_files_loader_merger/base.rb

Overview

Base class, #parse should be implemented in child classes

Direct Known Subclasses

JSON, YML

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Base

Returns a new instance of Base.

Parameters:

  • path (String)

    The file path of the option file



11
12
13
# File 'lib/opt_parse_validator/config_files_loader_merger/base.rb', line 11

def initialize(path)
  @path = path
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



8
9
10
# File 'lib/opt_parse_validator/config_files_loader_merger/base.rb', line 8

def path
  @path
end

Instance Method Details

#==(other) ⇒ Object



20
21
22
# File 'lib/opt_parse_validator/config_files_loader_merger/base.rb', line 20

def ==(other)
  path == other.path
end

#parseHash

Returns a { ‘key’ => value } hash.

Returns:

  • (Hash)

    a { ‘key’ => value } hash

Raises:

  • (NotImplementedError)


16
17
18
# File 'lib/opt_parse_validator/config_files_loader_merger/base.rb', line 16

def parse
  raise NotImplementedError
end