class RubyRedtail::Client

Public Class Methods

new(client = {}, api_hash) click to toggle source

help.redtailtechnology.com/entries/21654562-authentication-methods

# File lib/ruby-redtail/client.rb, line 4
def initialize(client = {}, api_hash)
  @api_hash = api_hash
  
  raise ArgumentError unless client['ClientID']
  @id = client['ClientID']
  
  raise ArgumentError if client.class != Hash
  client.each do |key, value|
    key = key.underscore
    self.class.send :attr_accessor, key
    instance_variable_set "@#{key}", value
  end
end