gonebusy-ruby-client 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/README.md +2 -1
  4. data/lib/gonebusy/controllers/bookings_controller.rb +77 -74
  5. data/lib/gonebusy/controllers/categories_controller.rb +29 -29
  6. data/lib/gonebusy/controllers/pricing_models_controller.rb +47 -47
  7. data/lib/gonebusy/controllers/resources_controller.rb +77 -77
  8. data/lib/gonebusy/controllers/schedules_controller.rb +92 -92
  9. data/lib/gonebusy/controllers/services_controller.rb +86 -86
  10. data/lib/gonebusy/controllers/users_controller.rb +56 -56
  11. data/lib/gonebusy/models/cancel_booking_by_id_response.rb +10 -12
  12. data/lib/gonebusy/models/create_booking_body.rb +78 -80
  13. data/lib/gonebusy/models/create_booking_response.rb +10 -12
  14. data/lib/gonebusy/models/create_category_body.rb +34 -36
  15. data/lib/gonebusy/models/create_category_response.rb +10 -12
  16. data/lib/gonebusy/models/create_pricing_model_body.rb +35 -37
  17. data/lib/gonebusy/models/create_pricing_model_response.rb +10 -12
  18. data/lib/gonebusy/models/create_resource_body.rb +39 -41
  19. data/lib/gonebusy/models/create_resource_response.rb +10 -12
  20. data/lib/gonebusy/models/create_schedule_body.rb +92 -94
  21. data/lib/gonebusy/models/create_schedule_response.rb +10 -12
  22. data/lib/gonebusy/models/create_schedule_time_window_body.rb +64 -66
  23. data/lib/gonebusy/models/create_schedule_time_window_response.rb +10 -12
  24. data/lib/gonebusy/models/create_service_body.rb +57 -59
  25. data/lib/gonebusy/models/create_service_response.rb +10 -12
  26. data/lib/gonebusy/models/create_user_body.rb +40 -42
  27. data/lib/gonebusy/models/create_user_response.rb +10 -12
  28. data/lib/gonebusy/models/delete_resource_by_id_response.rb +10 -12
  29. data/lib/gonebusy/models/delete_schedule_by_id_response.rb +10 -12
  30. data/lib/gonebusy/models/delete_schedule_time_window_by_id_response.rb +10 -12
  31. data/lib/gonebusy/models/delete_service_by_id_response.rb +10 -12
  32. data/lib/gonebusy/models/entities_address_entity.rb +69 -71
  33. data/lib/gonebusy/models/entities_availability_response.rb +21 -23
  34. data/lib/gonebusy/models/entities_booking_response.rb +32 -34
  35. data/lib/gonebusy/models/entities_category_response.rb +52 -54
  36. data/lib/gonebusy/models/entities_pricing_model_response.rb +44 -46
  37. data/lib/gonebusy/models/entities_resource_availabilities.rb +24 -26
  38. data/lib/gonebusy/models/entities_resource_response.rb +60 -62
  39. data/lib/gonebusy/models/entities_schedule_response.rb +26 -28
  40. data/lib/gonebusy/models/entities_search_response.rb +29 -31
  41. data/lib/gonebusy/models/entities_service_response.rb +82 -84
  42. data/lib/gonebusy/models/entities_slots.rb +13 -15
  43. data/lib/gonebusy/models/entities_thing_type_response.rb +13 -15
  44. data/lib/gonebusy/models/entities_time_window_response.rb +81 -83
  45. data/lib/gonebusy/models/entities_user_response.rb +95 -97
  46. data/lib/gonebusy/models/get_booking_by_id_response.rb +10 -12
  47. data/lib/gonebusy/models/get_bookings_response.rb +14 -16
  48. data/lib/gonebusy/models/get_categories_response.rb +14 -16
  49. data/lib/gonebusy/models/get_category_by_id_response.rb +10 -12
  50. data/lib/gonebusy/models/get_pricing_model_by_id_response.rb +10 -12
  51. data/lib/gonebusy/models/get_pricing_models_response.rb +14 -16
  52. data/lib/gonebusy/models/get_resource_by_id_response.rb +10 -12
  53. data/lib/gonebusy/models/get_resource_things_response.rb +14 -16
  54. data/lib/gonebusy/models/get_resources_response.rb +14 -16
  55. data/lib/gonebusy/models/get_schedule_by_id_response.rb +10 -12
  56. data/lib/gonebusy/models/get_schedules_response.rb +14 -16
  57. data/lib/gonebusy/models/get_service_available_slots_by_id_response.rb +10 -12
  58. data/lib/gonebusy/models/get_service_by_id_response.rb +10 -12
  59. data/lib/gonebusy/models/get_services_response.rb +14 -16
  60. data/lib/gonebusy/models/get_user_by_id_response.rb +10 -12
  61. data/lib/gonebusy/models/get_users_response.rb +14 -16
  62. data/lib/gonebusy/models/search_query_response.rb +10 -12
  63. data/lib/gonebusy/models/update_booking_by_id_body.rb +58 -60
  64. data/lib/gonebusy/models/update_booking_by_id_response.rb +10 -12
  65. data/lib/gonebusy/models/update_pricing_model_by_id_body.rb +28 -30
  66. data/lib/gonebusy/models/update_pricing_model_by_id_response.rb +10 -12
  67. data/lib/gonebusy/models/update_resource_by_id_body.rb +33 -35
  68. data/lib/gonebusy/models/update_resource_by_id_response.rb +10 -12
  69. data/lib/gonebusy/models/update_schedule_time_window_by_id_body.rb +71 -73
  70. data/lib/gonebusy/models/update_schedule_time_window_by_id_response.rb +10 -12
  71. data/lib/gonebusy/models/update_service_by_id_body.rb +43 -45
  72. data/lib/gonebusy/models/update_service_by_id_response.rb +10 -12
  73. data/lib/gonebusy/models/update_user_by_id_body.rb +41 -43
  74. data/lib/gonebusy/models/update_user_by_id_response.rb +10 -12
  75. data/lib/gonebusy.rb +67 -67
  76. metadata +2 -3
  77. data/lib/gonebusy/exceptions/entities_error_exception.rb +0 -27
@@ -8,11 +8,11 @@ module Gonebusy
8
8
 
9
9
  # A mapping from model property names to API property names
10
10
  def self.names
11
- if @hash.nil?
12
- @hash = {}
13
- @hash["category"] = "category"
11
+ if @_hash.nil?
12
+ @_hash = {}
13
+ @_hash["category"] = "category"
14
14
  end
15
- @hash
15
+ @_hash
16
16
  end
17
17
 
18
18
  def initialize(category = nil)
@@ -21,15 +21,13 @@ module Gonebusy
21
21
 
22
22
  # Creates an instance of the object from a hash
23
23
  def self.from_hash(hash)
24
- if hash == nil
25
- nil
26
- else
27
- # Extract variables from the hash
28
- category = EntitiesCategoryResponse.from_hash(hash['category']) if hash['category']
24
+ return nil unless hash
29
25
 
30
- # Create object from extracted values
31
- GetCategoryByIdResponse.new(category)
32
- end
26
+ # Extract variables from the hash
27
+ category = EntitiesCategoryResponse.from_hash(hash['category']) if hash['category']
28
+
29
+ # Create object from extracted values
30
+ GetCategoryByIdResponse.new(category)
33
31
  end
34
32
  end
35
33
  end
@@ -8,11 +8,11 @@ module Gonebusy
8
8
 
9
9
  # A mapping from model property names to API property names
10
10
  def self.names
11
- if @hash.nil?
12
- @hash = {}
13
- @hash["pricing_model"] = "pricing_model"
11
+ if @_hash.nil?
12
+ @_hash = {}
13
+ @_hash["pricing_model"] = "pricing_model"
14
14
  end
15
- @hash
15
+ @_hash
16
16
  end
17
17
 
18
18
  def initialize(pricing_model = nil)
@@ -21,15 +21,13 @@ module Gonebusy
21
21
 
22
22
  # Creates an instance of the object from a hash
23
23
  def self.from_hash(hash)
24
- if hash == nil
25
- nil
26
- else
27
- # Extract variables from the hash
28
- pricing_model = EntitiesPricingModelResponse.from_hash(hash['pricing_model']) if hash['pricing_model']
24
+ return nil unless hash
29
25
 
30
- # Create object from extracted values
31
- GetPricingModelByIdResponse.new(pricing_model)
32
- end
26
+ # Extract variables from the hash
27
+ pricing_model = EntitiesPricingModelResponse.from_hash(hash['pricing_model']) if hash['pricing_model']
28
+
29
+ # Create object from extracted values
30
+ GetPricingModelByIdResponse.new(pricing_model)
33
31
  end
34
32
  end
35
33
  end
@@ -8,11 +8,11 @@ module Gonebusy
8
8
 
9
9
  # A mapping from model property names to API property names
10
10
  def self.names
11
- if @hash.nil?
12
- @hash = {}
13
- @hash["pricing_models"] = "pricing_models"
11
+ if @_hash.nil?
12
+ @_hash = {}
13
+ @_hash["pricing_models"] = "pricing_models"
14
14
  end
15
- @hash
15
+ @_hash
16
16
  end
17
17
 
18
18
  def initialize(pricing_models = nil)
@@ -21,20 +21,18 @@ module Gonebusy
21
21
 
22
22
  # Creates an instance of the object from a hash
23
23
  def self.from_hash(hash)
24
- if hash == nil
25
- nil
26
- else
27
- # Extract variables from the hash
28
- # Parameter is an array, so we need to iterate through it
29
- pricing_models = nil
30
- if hash['pricing_models'] != nil
31
- pricing_models = Array.new
32
- hash['pricing_models'].each{|structure| pricing_models << (EntitiesPricingModelResponse.from_hash(structure) if structure)}
33
- end
24
+ return nil unless hash
34
25
 
35
- # Create object from extracted values
36
- GetPricingModelsResponse.new(pricing_models)
26
+ # Extract variables from the hash
27
+ # Parameter is an array, so we need to iterate through it
28
+ pricing_models = nil
29
+ if hash['pricing_models'] != nil
30
+ pricing_models = Array.new
31
+ hash['pricing_models'].each{|structure| pricing_models << (EntitiesPricingModelResponse.from_hash(structure) if structure)}
37
32
  end
33
+
34
+ # Create object from extracted values
35
+ GetPricingModelsResponse.new(pricing_models)
38
36
  end
39
37
  end
40
38
  end
@@ -8,11 +8,11 @@ module Gonebusy
8
8
 
9
9
  # A mapping from model property names to API property names
10
10
  def self.names
11
- if @hash.nil?
12
- @hash = {}
13
- @hash["resource"] = "resource"
11
+ if @_hash.nil?
12
+ @_hash = {}
13
+ @_hash["resource"] = "resource"
14
14
  end
15
- @hash
15
+ @_hash
16
16
  end
17
17
 
18
18
  def initialize(resource = nil)
@@ -21,15 +21,13 @@ module Gonebusy
21
21
 
22
22
  # Creates an instance of the object from a hash
23
23
  def self.from_hash(hash)
24
- if hash == nil
25
- nil
26
- else
27
- # Extract variables from the hash
28
- resource = EntitiesResourceResponse.from_hash(hash['resource']) if hash['resource']
24
+ return nil unless hash
29
25
 
30
- # Create object from extracted values
31
- GetResourceByIdResponse.new(resource)
32
- end
26
+ # Extract variables from the hash
27
+ resource = EntitiesResourceResponse.from_hash(hash['resource']) if hash['resource']
28
+
29
+ # Create object from extracted values
30
+ GetResourceByIdResponse.new(resource)
33
31
  end
34
32
  end
35
33
  end
@@ -8,11 +8,11 @@ module Gonebusy
8
8
 
9
9
  # A mapping from model property names to API property names
10
10
  def self.names
11
- if @hash.nil?
12
- @hash = {}
13
- @hash["things"] = "things"
11
+ if @_hash.nil?
12
+ @_hash = {}
13
+ @_hash["things"] = "things"
14
14
  end
15
- @hash
15
+ @_hash
16
16
  end
17
17
 
18
18
  def initialize(things = nil)
@@ -21,20 +21,18 @@ module Gonebusy
21
21
 
22
22
  # Creates an instance of the object from a hash
23
23
  def self.from_hash(hash)
24
- if hash == nil
25
- nil
26
- else
27
- # Extract variables from the hash
28
- # Parameter is an array, so we need to iterate through it
29
- things = nil
30
- if hash['things'] != nil
31
- things = Array.new
32
- hash['things'].each{|structure| things << (EntitiesThingTypeResponse.from_hash(structure) if structure)}
33
- end
24
+ return nil unless hash
34
25
 
35
- # Create object from extracted values
36
- GetResourceThingsResponse.new(things)
26
+ # Extract variables from the hash
27
+ # Parameter is an array, so we need to iterate through it
28
+ things = nil
29
+ if hash['things'] != nil
30
+ things = Array.new
31
+ hash['things'].each{|structure| things << (EntitiesThingTypeResponse.from_hash(structure) if structure)}
37
32
  end
33
+
34
+ # Create object from extracted values
35
+ GetResourceThingsResponse.new(things)
38
36
  end
39
37
  end
40
38
  end
@@ -8,11 +8,11 @@ module Gonebusy
8
8
 
9
9
  # A mapping from model property names to API property names
10
10
  def self.names
11
- if @hash.nil?
12
- @hash = {}
13
- @hash["resources"] = "resources"
11
+ if @_hash.nil?
12
+ @_hash = {}
13
+ @_hash["resources"] = "resources"
14
14
  end
15
- @hash
15
+ @_hash
16
16
  end
17
17
 
18
18
  def initialize(resources = nil)
@@ -21,20 +21,18 @@ module Gonebusy
21
21
 
22
22
  # Creates an instance of the object from a hash
23
23
  def self.from_hash(hash)
24
- if hash == nil
25
- nil
26
- else
27
- # Extract variables from the hash
28
- # Parameter is an array, so we need to iterate through it
29
- resources = nil
30
- if hash['resources'] != nil
31
- resources = Array.new
32
- hash['resources'].each{|structure| resources << (EntitiesResourceResponse.from_hash(structure) if structure)}
33
- end
24
+ return nil unless hash
34
25
 
35
- # Create object from extracted values
36
- GetResourcesResponse.new(resources)
26
+ # Extract variables from the hash
27
+ # Parameter is an array, so we need to iterate through it
28
+ resources = nil
29
+ if hash['resources'] != nil
30
+ resources = Array.new
31
+ hash['resources'].each{|structure| resources << (EntitiesResourceResponse.from_hash(structure) if structure)}
37
32
  end
33
+
34
+ # Create object from extracted values
35
+ GetResourcesResponse.new(resources)
38
36
  end
39
37
  end
40
38
  end
@@ -8,11 +8,11 @@ module Gonebusy
8
8
 
9
9
  # A mapping from model property names to API property names
10
10
  def self.names
11
- if @hash.nil?
12
- @hash = {}
13
- @hash["schedule"] = "schedule"
11
+ if @_hash.nil?
12
+ @_hash = {}
13
+ @_hash["schedule"] = "schedule"
14
14
  end
15
- @hash
15
+ @_hash
16
16
  end
17
17
 
18
18
  def initialize(schedule = nil)
@@ -21,15 +21,13 @@ module Gonebusy
21
21
 
22
22
  # Creates an instance of the object from a hash
23
23
  def self.from_hash(hash)
24
- if hash == nil
25
- nil
26
- else
27
- # Extract variables from the hash
28
- schedule = EntitiesScheduleResponse.from_hash(hash['schedule']) if hash['schedule']
24
+ return nil unless hash
29
25
 
30
- # Create object from extracted values
31
- GetScheduleByIdResponse.new(schedule)
32
- end
26
+ # Extract variables from the hash
27
+ schedule = EntitiesScheduleResponse.from_hash(hash['schedule']) if hash['schedule']
28
+
29
+ # Create object from extracted values
30
+ GetScheduleByIdResponse.new(schedule)
33
31
  end
34
32
  end
35
33
  end
@@ -8,11 +8,11 @@ module Gonebusy
8
8
 
9
9
  # A mapping from model property names to API property names
10
10
  def self.names
11
- if @hash.nil?
12
- @hash = {}
13
- @hash["schedules"] = "schedules"
11
+ if @_hash.nil?
12
+ @_hash = {}
13
+ @_hash["schedules"] = "schedules"
14
14
  end
15
- @hash
15
+ @_hash
16
16
  end
17
17
 
18
18
  def initialize(schedules = nil)
@@ -21,20 +21,18 @@ module Gonebusy
21
21
 
22
22
  # Creates an instance of the object from a hash
23
23
  def self.from_hash(hash)
24
- if hash == nil
25
- nil
26
- else
27
- # Extract variables from the hash
28
- # Parameter is an array, so we need to iterate through it
29
- schedules = nil
30
- if hash['schedules'] != nil
31
- schedules = Array.new
32
- hash['schedules'].each{|structure| schedules << (EntitiesScheduleResponse.from_hash(structure) if structure)}
33
- end
24
+ return nil unless hash
34
25
 
35
- # Create object from extracted values
36
- GetSchedulesResponse.new(schedules)
26
+ # Extract variables from the hash
27
+ # Parameter is an array, so we need to iterate through it
28
+ schedules = nil
29
+ if hash['schedules'] != nil
30
+ schedules = Array.new
31
+ hash['schedules'].each{|structure| schedules << (EntitiesScheduleResponse.from_hash(structure) if structure)}
37
32
  end
33
+
34
+ # Create object from extracted values
35
+ GetSchedulesResponse.new(schedules)
38
36
  end
39
37
  end
40
38
  end
@@ -8,11 +8,11 @@ module Gonebusy
8
8
 
9
9
  # A mapping from model property names to API property names
10
10
  def self.names
11
- if @hash.nil?
12
- @hash = {}
13
- @hash["service"] = "service"
11
+ if @_hash.nil?
12
+ @_hash = {}
13
+ @_hash["service"] = "service"
14
14
  end
15
- @hash
15
+ @_hash
16
16
  end
17
17
 
18
18
  def initialize(service = nil)
@@ -21,15 +21,13 @@ module Gonebusy
21
21
 
22
22
  # Creates an instance of the object from a hash
23
23
  def self.from_hash(hash)
24
- if hash == nil
25
- nil
26
- else
27
- # Extract variables from the hash
28
- service = EntitiesAvailabilityResponse.from_hash(hash['service']) if hash['service']
24
+ return nil unless hash
29
25
 
30
- # Create object from extracted values
31
- GetServiceAvailableSlotsByIdResponse.new(service)
32
- end
26
+ # Extract variables from the hash
27
+ service = EntitiesAvailabilityResponse.from_hash(hash['service']) if hash['service']
28
+
29
+ # Create object from extracted values
30
+ GetServiceAvailableSlotsByIdResponse.new(service)
33
31
  end
34
32
  end
35
33
  end
@@ -8,11 +8,11 @@ module Gonebusy
8
8
 
9
9
  # A mapping from model property names to API property names
10
10
  def self.names
11
- if @hash.nil?
12
- @hash = {}
13
- @hash["service"] = "service"
11
+ if @_hash.nil?
12
+ @_hash = {}
13
+ @_hash["service"] = "service"
14
14
  end
15
- @hash
15
+ @_hash
16
16
  end
17
17
 
18
18
  def initialize(service = nil)
@@ -21,15 +21,13 @@ module Gonebusy
21
21
 
22
22
  # Creates an instance of the object from a hash
23
23
  def self.from_hash(hash)
24
- if hash == nil
25
- nil
26
- else
27
- # Extract variables from the hash
28
- service = EntitiesServiceResponse.from_hash(hash['service']) if hash['service']
24
+ return nil unless hash
29
25
 
30
- # Create object from extracted values
31
- GetServiceByIdResponse.new(service)
32
- end
26
+ # Extract variables from the hash
27
+ service = EntitiesServiceResponse.from_hash(hash['service']) if hash['service']
28
+
29
+ # Create object from extracted values
30
+ GetServiceByIdResponse.new(service)
33
31
  end
34
32
  end
35
33
  end
@@ -8,11 +8,11 @@ module Gonebusy
8
8
 
9
9
  # A mapping from model property names to API property names
10
10
  def self.names
11
- if @hash.nil?
12
- @hash = {}
13
- @hash["services"] = "services"
11
+ if @_hash.nil?
12
+ @_hash = {}
13
+ @_hash["services"] = "services"
14
14
  end
15
- @hash
15
+ @_hash
16
16
  end
17
17
 
18
18
  def initialize(services = nil)
@@ -21,20 +21,18 @@ module Gonebusy
21
21
 
22
22
  # Creates an instance of the object from a hash
23
23
  def self.from_hash(hash)
24
- if hash == nil
25
- nil
26
- else
27
- # Extract variables from the hash
28
- # Parameter is an array, so we need to iterate through it
29
- services = nil
30
- if hash['services'] != nil
31
- services = Array.new
32
- hash['services'].each{|structure| services << (EntitiesServiceResponse.from_hash(structure) if structure)}
33
- end
24
+ return nil unless hash
34
25
 
35
- # Create object from extracted values
36
- GetServicesResponse.new(services)
26
+ # Extract variables from the hash
27
+ # Parameter is an array, so we need to iterate through it
28
+ services = nil
29
+ if hash['services'] != nil
30
+ services = Array.new
31
+ hash['services'].each{|structure| services << (EntitiesServiceResponse.from_hash(structure) if structure)}
37
32
  end
33
+
34
+ # Create object from extracted values
35
+ GetServicesResponse.new(services)
38
36
  end
39
37
  end
40
38
  end
@@ -8,11 +8,11 @@ module Gonebusy
8
8
 
9
9
  # A mapping from model property names to API property names
10
10
  def self.names
11
- if @hash.nil?
12
- @hash = {}
13
- @hash["user"] = "user"
11
+ if @_hash.nil?
12
+ @_hash = {}
13
+ @_hash["user"] = "user"
14
14
  end
15
- @hash
15
+ @_hash
16
16
  end
17
17
 
18
18
  def initialize(user = nil)
@@ -21,15 +21,13 @@ module Gonebusy
21
21
 
22
22
  # Creates an instance of the object from a hash
23
23
  def self.from_hash(hash)
24
- if hash == nil
25
- nil
26
- else
27
- # Extract variables from the hash
28
- user = EntitiesUserResponse.from_hash(hash['user']) if hash['user']
24
+ return nil unless hash
29
25
 
30
- # Create object from extracted values
31
- GetUserByIdResponse.new(user)
32
- end
26
+ # Extract variables from the hash
27
+ user = EntitiesUserResponse.from_hash(hash['user']) if hash['user']
28
+
29
+ # Create object from extracted values
30
+ GetUserByIdResponse.new(user)
33
31
  end
34
32
  end
35
33
  end
@@ -8,11 +8,11 @@ module Gonebusy
8
8
 
9
9
  # A mapping from model property names to API property names
10
10
  def self.names
11
- if @hash.nil?
12
- @hash = {}
13
- @hash["users"] = "users"
11
+ if @_hash.nil?
12
+ @_hash = {}
13
+ @_hash["users"] = "users"
14
14
  end
15
- @hash
15
+ @_hash
16
16
  end
17
17
 
18
18
  def initialize(users = nil)
@@ -21,20 +21,18 @@ module Gonebusy
21
21
 
22
22
  # Creates an instance of the object from a hash
23
23
  def self.from_hash(hash)
24
- if hash == nil
25
- nil
26
- else
27
- # Extract variables from the hash
28
- # Parameter is an array, so we need to iterate through it
29
- users = nil
30
- if hash['users'] != nil
31
- users = Array.new
32
- hash['users'].each{|structure| users << (EntitiesUserResponse.from_hash(structure) if structure)}
33
- end
24
+ return nil unless hash
34
25
 
35
- # Create object from extracted values
36
- GetUsersResponse.new(users)
26
+ # Extract variables from the hash
27
+ # Parameter is an array, so we need to iterate through it
28
+ users = nil
29
+ if hash['users'] != nil
30
+ users = Array.new
31
+ hash['users'].each{|structure| users << (EntitiesUserResponse.from_hash(structure) if structure)}
37
32
  end
33
+
34
+ # Create object from extracted values
35
+ GetUsersResponse.new(users)
38
36
  end
39
37
  end
40
38
  end
@@ -8,11 +8,11 @@ module Gonebusy
8
8
 
9
9
  # A mapping from model property names to API property names
10
10
  def self.names
11
- if @hash.nil?
12
- @hash = {}
13
- @hash["results"] = "results"
11
+ if @_hash.nil?
12
+ @_hash = {}
13
+ @_hash["results"] = "results"
14
14
  end
15
- @hash
15
+ @_hash
16
16
  end
17
17
 
18
18
  def initialize(results = nil)
@@ -21,15 +21,13 @@ module Gonebusy
21
21
 
22
22
  # Creates an instance of the object from a hash
23
23
  def self.from_hash(hash)
24
- if hash == nil
25
- nil
26
- else
27
- # Extract variables from the hash
28
- results = EntitiesSearchResponse.from_hash(hash['results']) if hash['results']
24
+ return nil unless hash
29
25
 
30
- # Create object from extracted values
31
- SearchQueryResponse.new(results)
32
- end
26
+ # Extract variables from the hash
27
+ results = EntitiesSearchResponse.from_hash(hash['results']) if hash['results']
28
+
29
+ # Create object from extracted values
30
+ SearchQueryResponse.new(results)
33
31
  end
34
32
  end
35
33
  end