Class: RequestParams

Inherits:
ParamsBase show all
Defined in:
lib/params/request_params.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ParamsBase

#[], #add, #find_or_add, #get, #method_missing, #required

Constructor Details

#initialize(path) ⇒ RequestParams

Returns a new instance of RequestParams.



6
7
8
9
10
11
12
13
# File 'lib/params/request_params.rb', line 6

def initialize(path)
  @file_path = "#{path}/request_data.json"

  if File.exist?(@file_path)
    BrpmAuto.log "Loading the request params from #{@file_path}..."
    self.merge!(get_request_params)
  end
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ParamsBase

Instance Attribute Details

#file_pathObject (readonly)

Returns the value of attribute file_path.



4
5
6
# File 'lib/params/request_params.rb', line 4

def file_path
  @file_path
end

Class Method Details

.new_for_request(automation_results_dir, app_name, request_id) ⇒ Object



15
16
17
# File 'lib/params/request_params.rb', line 15

def self.new_for_request(automation_results_dir, app_name, request_id)
  self.new("#{automation_results_dir}/request/#{app_name.gsub(" ", "_")}/#{request_id}")
end

Instance Method Details

#[]=(key, val) ⇒ Object



19
20
21
22
23
# File 'lib/params/request_params.rb', line 19

def []=(key,val)
  super(key, val)

  set_request_params
end