class SFRest::Variable

Perform actions against variables in the Factory

Public Class Methods

new(conn) click to toggle source

@param [SFRest::Connection] conn

# File lib/sfrest/variable.rb, line 7
def initialize(conn)
  @conn = conn
end

Public Instance Methods

get_variable(name) click to toggle source

Gets the value of a specific variable.

# File lib/sfrest/variable.rb, line 18
def get_variable(name)
  current_path = "/api/v1/variables?name=#{name}"
  @conn.get(current_path)
end
set_variable(name, value) click to toggle source

Sets the key and value of a variable.

# File lib/sfrest/variable.rb, line 24
def set_variable(name, value)
  current_path = '/api/v1/variables'
  payload = { 'name' => name, 'value' => value }.to_json
  @conn.put(current_path, payload)
end
variable_list() click to toggle source

Gets the list of variables.

# File lib/sfrest/variable.rb, line 12
def variable_list
  current_path = '/api/v1/variables'
  @conn.get(current_path)
end