Class: TestCentricity::EnvironData

Inherits:
ExcelDataSource show all
Defined in:
lib/testcentricity_web/data_objects/environment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from ExcelDataSource

#pick_excel_data_source, #read_excel_pool_data, #read_excel_range_data, #read_excel_row_data

Methods inherited from DataSource

#read_json_node_data, #read_yaml_node_data

Instance Attribute Details

#currentObject

Returns the value of attribute current.



3
4
5
# File 'lib/testcentricity_web/data_objects/environment.rb', line 3

def current
  @current
end

Instance Method Details

#find_environ(environ_name, source_type = :excel) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/testcentricity_web/data_objects/environment.rb', line 7

def find_environ(environ_name, source_type = :excel)
  case source_type
  when :excel
    data = ExcelData.read_row_data(XL_PRIMARY_DATA_FILE, WKS_ENVIRONS, environ_name)
  when :yaml
    data = read_yaml_node_data('environments.yml', environ_name)
  when :json
    data = read_json_node_data('environments.json', environ_name)
  end
  @current = Environ.new(data)
  Environ.current = @current
end