Class: Exa::Services::WebsetsParameterConverter

Inherits:
Object
  • Object
show all
Defined in:
lib/exa/services/websets_parameter_converter.rb

Overview

Converts Ruby parameter names (snake_case) to API format (camelCase) for Websets API

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.convert(params) ⇒ Object



7
8
9
# File 'lib/exa/services/websets_parameter_converter.rb', line 7

def self.convert(params)
  new.convert(params)
end

Instance Method Details

#convert(params) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/exa/services/websets_parameter_converter.rb', line 11

def convert(params)
  converted = {}

  params.each do |key, value|
    converted_key = convert_key(key)
    converted_value = convert_value(key, value)
    converted[converted_key] = converted_value
  end

  converted
end