Class: Recras::Person
- Inherits:
-
Object
- Object
- Recras::Person
- Extended by:
- Recras
- Defined in:
- lib/recras/person.rb
Constant Summary
Constants included from Recras
Instance Attribute Summary collapse
-
#address ⇒ Object
Returns the value of attribute address.
-
#bank_account_number ⇒ Object
Returns the value of attribute bank_account_number.
-
#city ⇒ Object
Returns the value of attribute city.
-
#company_id ⇒ Object
Returns the value of attribute company_id.
-
#country_code ⇒ Object
Returns the value of attribute country_code.
-
#email ⇒ Object
Returns the value of attribute email.
- #first_name ⇒ Object
-
#id ⇒ Object
Returns the value of attribute id.
-
#json ⇒ Object
Returns the value of attribute json.
-
#last_name ⇒ Object
Returns the value of attribute last_name.
-
#name ⇒ Object
Returns the value of attribute name.
-
#phone ⇒ Object
Returns the value of attribute phone.
-
#postal_code ⇒ Object
Returns the value of attribute postal_code.
-
#region_code ⇒ Object
Returns the value of attribute region_code.
-
#vat_number ⇒ Object
Returns the value of attribute vat_number.
Class Method Summary collapse
-
.attribute_mapping ⇒ Object
translates the mapping between the Recras API and the terms used in this gem.
Instance Method Summary collapse
-
#initialize(args = nil) ⇒ Person
constructor
Initializer to transform a
Hashinto an Client object.
Methods included from Recras
make_request, new_from_json, object_mappings, parse_json, url, version
Constructor Details
#initialize(args = nil) ⇒ Person
Initializer to transform a Hash into an Client object
28 29 30 31 32 33 34 35 36 37 38 39 40 |
# 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 |
Instance Attribute Details
#address ⇒ Object
Returns the value of attribute address.
9 10 11 |
# File 'lib/recras/person.rb', line 9 def address @address end |
#bank_account_number ⇒ Object
Returns the value of attribute bank_account_number.
16 17 18 |
# File 'lib/recras/person.rb', line 16 def bank_account_number @bank_account_number end |
#city ⇒ Object
Returns the value of attribute city.
11 12 13 |
# File 'lib/recras/person.rb', line 11 def city @city end |
#company_id ⇒ Object
Returns the value of attribute company_id.
15 16 17 |
# File 'lib/recras/person.rb', line 15 def company_id @company_id end |
#country_code ⇒ Object
Returns the value of attribute country_code.
12 13 14 |
# File 'lib/recras/person.rb', line 12 def country_code @country_code end |
#email ⇒ Object
Returns the value of attribute email.
20 21 22 |
# File 'lib/recras/person.rb', line 20 def email @email end |
#first_name ⇒ Object
The is a required parameter.
6 7 8 |
# File 'lib/recras/person.rb', line 6 def first_name @first_name end |
#id ⇒ Object
Returns the value of attribute id.
7 8 9 |
# File 'lib/recras/person.rb', line 7 def id @id end |
#json ⇒ Object
Returns the value of attribute json.
21 22 23 |
# File 'lib/recras/person.rb', line 21 def json @json end |
#last_name ⇒ Object
Returns the value of attribute last_name.
18 19 20 |
# File 'lib/recras/person.rb', line 18 def last_name @last_name end |
#name ⇒ Object
Returns the value of attribute name.
8 9 10 |
# File 'lib/recras/person.rb', line 8 def name @name end |
#phone ⇒ Object
Returns the value of attribute phone.
19 20 21 |
# File 'lib/recras/person.rb', line 19 def phone @phone end |
#postal_code ⇒ Object
Returns the value of attribute postal_code.
10 11 12 |
# File 'lib/recras/person.rb', line 10 def postal_code @postal_code end |
#region_code ⇒ Object
Returns the value of attribute region_code.
13 14 15 |
# File 'lib/recras/person.rb', line 13 def region_code @region_code end |
#vat_number ⇒ Object
Returns the value of attribute vat_number.
14 15 16 |
# File 'lib/recras/person.rb', line 14 def vat_number @vat_number end |
Class Method Details
.attribute_mapping ⇒ Object
translates the mapping between the Recras API and the terms used in this gem
44 45 46 |
# 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 |