Module: Renogen::ExtractionStratagies

Defined in:
lib/renogen/extraction_stratagies.rb,
lib/renogen/extraction_stratagies/base.rb,
lib/renogen/extraction_stratagies/yaml_file.rb,
lib/renogen/extraction_stratagies/yaml_file/parser.rb,
lib/renogen/extraction_stratagies/yaml_file/reader.rb,
lib/renogen/extraction_stratagies/yaml_file/provider.rb,
lib/renogen/extraction_stratagies/yaml_file/exceptions.rb,
lib/renogen/extraction_stratagies/yaml_file/exceptions/yaml_file_blank.rb

Overview

Methods for extracting release notes

Defined Under Namespace

Modules: YamlFile Classes: Base

Class Method Summary collapse

Class Method Details

.add(identifier, klass) ⇒ Object

Adds a new stratagy class to store

Parameters:

  • identifier (Symbol)
  • klass (Symbol)


25
26
27
28
# File 'lib/renogen/extraction_stratagies.rb', line 25

def add(identifier, klass)
  # raise 'name taken' unless stratagies[name].nil?
  stratagies[identifier.to_s]=klass
end

.obtain(stratagy_type, options = {}) ⇒ ExtractionStratagies::Base

Retrieves a stratagy from a given key

Parameters:

  • stratagy_type (String)

    identifier for stratagy

  • options (Hash) (defaults to: {})

    any options required for stratagy

Returns:



12
13
14
15
16
17
18
19
# File 'lib/renogen/extraction_stratagies.rb', line 12

def obtain(stratagy_type, options={})
  stratagy = stratagies[stratagy_type.to_s]
  if stratagy
    stratagy.new(options)
  else
    raise Renogen::Exceptions::StratagyNotFound.new(stratagy_type)
  end
end