class Recras::Person

Attributes

address[RW]
bank_account_number[RW]
city[RW]
company_id[RW]
country_code[RW]
email[RW]
first_name[RW]

@note The is a required parameter.

id[RW]
json[RW]
last_name[RW]
name[RW]
phone[RW]
postal_code[RW]
region_code[RW]
vat_number[RW]

Public Class Methods

attribute_mapping() click to toggle source

translates the mapping between the Recras API and the terms used in this gem

# File lib/recras/person.rb, line 44
def self.attribute_mapping
  [["id", "id"],["displaynaam", "name"],["adres", "address"],["postcode", "postal_code"], ["plaats", "city"], ["landcode", "country_code"],["bedrijf_id", "company_id"],["telefoon1","phone"],["email1", "email"]]
end
new(args=nil) click to toggle source

Initializer to transform a Hash into an Client object

@param [Hash] args

# File lib/recras/person.rb, line 28
def initialize(args=nil)
  required_args = []
  for arg in required_args
    if args.nil? || args[arg].nil?
      raise RecrasError.new(self), "Insufficient login credentials. Please provide @username, @password"
    end
  end

  return if args.nil?
  args.each do |k,v|
    instance_variable_set("@#{k}", v) unless v.nil?
  end
end