Skip to content

Commit

Permalink
Rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
A5308Y committed Dec 15, 2021
1 parent 5daf628 commit f8f89ab
Show file tree
Hide file tree
Showing 89 changed files with 3,525 additions and 2,986 deletions.
12 changes: 9 additions & 3 deletions lib/ioki/model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@
require 'ioki/model/passenger/base'
require 'ioki/model/driver/base'

Dir[File.join(__dir__, 'model', 'platform', '*')].reject { |filename| filename == File.join(__dir__, 'model', 'platform', 'base.rb') }.sort.each { |file| require file }
Dir[File.join(__dir__, 'model', 'passenger', '*')].reject { |filename| filename == File.join(__dir__, 'model', 'passenger', 'base.rb') }.sort.each { |file| require file }
Dir[File.join(__dir__, 'model', 'driver', '*')].reject { |filename| filename == File.join(__dir__, 'model', 'driver', 'base.rb') }.sort.each { |file| require file }
Dir[File.join(__dir__, 'model', 'platform', '*')].reject do |filename|
filename == File.join(__dir__, 'model', 'platform', 'base.rb')
end.sort.each { |file| require file }
Dir[File.join(__dir__, 'model', 'passenger', '*')].reject do |filename|
filename == File.join(__dir__, 'model', 'passenger', 'base.rb')
end.sort.each { |file| require file }
Dir[File.join(__dir__, 'model', 'driver', '*')].reject do |filename|
filename == File.join(__dir__, 'model', 'driver', 'base.rb')
end.sort.each { |file| require file }

module Ioki
module Model
Expand Down
6 changes: 4 additions & 2 deletions lib/ioki/model/driver/driver_request_token.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ module Ioki
module Model
module Driver
class DriverRequestToken < Base
attribute :username, on: :create, type: :string, unvalidated: true # The model does not return it but it's used when sending data to the server.
attribute :pin, on: :create, type: :string, unvalidated: true # The model does not return it but it's used when sending data to the server.
# The model does not return it but it's used when sending data to the server.
attribute :username, on: :create, type: :string, unvalidated: true
# The model does not return it but it's used when sending data to the server.
attribute :pin, on: :create, type: :string, unvalidated: true
attribute :token, on: :read, type: :string
attribute :driver_id, on: :read, type: :string
end
Expand Down
3 changes: 2 additions & 1 deletion lib/ioki/model/driver/passenger_options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ module Ioki
module Model
module Driver
class PassengerOptions < Ioki::Model::Base
# Note that this does not inherit from Base because it does not implement :type, :id, :created_at and :updated_at.
# Note that this does not inherit from Base because it does not implement :type, :id, :created_at and
# :updated_at.

unvalidated true # Specification not available.

Expand Down
3 changes: 2 additions & 1 deletion lib/ioki/model/driver/passenger_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ module Ioki
module Model
module Driver
class PassengerType < Ioki::Model::Base
# Note that this does not inherit from Base because it does not implement :type, :id, :created_at and :updated_at.
# Note that this does not inherit from Base because it does not implement :type, :id, :created_at and
# :updated_at.

unvalidated true # Specification not available.

Expand Down
3 changes: 2 additions & 1 deletion lib/ioki/model/driver/prebooking_threshold.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ module Ioki
module Model
module Driver
class PrebookingThreshold < Ioki::Model::Base
# Note that this does not inherit from Base because it does not implement :type, :id, :created_at and :updated_at.
# Note that this does not inherit from Base because it does not implement :type, :id, :created_at and
# :updated_at.

unvalidated true # Specification not available.

Expand Down
3 changes: 2 additions & 1 deletion lib/ioki/model/driver/ride_options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ module Ioki
module Model
module Driver
class RideOptions < Ioki::Model::Base
# Note that this does not inherit from Base because it does not implement :type, :id, :created_at and :updated_at.
# Note that this does not inherit from Base because it does not implement :type, :id, :created_at and
# :updated_at.

unvalidated true # Specification not available.

Expand Down
3 changes: 2 additions & 1 deletion lib/ioki/model/passenger/availability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ module Ioki
module Model
module Passenger
class Availability < Ioki::Model::Base
# Note that this does not inherit from Base because it does not implement :type, :id, :created_at and :updated_at.
# Note that this does not inherit from Base because it does not implement :type, :id, :created_at and
# :updated_at.

unvalidated true # No specification available

Expand Down
6 changes: 4 additions & 2 deletions lib/ioki/model/passenger/booking.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ module Model
module Passenger
class Booking < Base
attribute :verification_code, type: :string, on: [:read, :update]
attribute :ride_version, type: :integer, on: :create, unvalidated: true # The model does not return it but it's used when sending data to the server.
attribute :payment_method, type: :object, on: :create, model_class: PaymentMethod, unvalidated: true # The model does not return it but it's used when sending data to the server.
# The model does not return it but it's used when sending data to the server.
attribute :ride_version, type: :integer, on: :create, unvalidated: true
# The model does not return it but it's used when sending data to the server.
attribute :payment_method, type: :object, on: :create, model_class: PaymentMethod, unvalidated: true
end
end
end
Expand Down
3 changes: 2 additions & 1 deletion lib/ioki/model/passenger/bounding_box.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ module Ioki
module Model
module Passenger
class BoundingBox < Ioki::Model::Base
# Note that this does not inherit from Base because it does not implement :created_at, :updated_at, :type and :id.
# Note that this does not inherit from Base because it does not implement :created_at, :updated_at, :type and
# :id.

def self.schema_path
'bounding_box'
Expand Down
3 changes: 2 additions & 1 deletion lib/ioki/model/passenger/constraints.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ module Ioki
module Model
module Passenger
class Constraints < Ioki::Model::Base
# Note that this does not inherit from Base because it does not implement :created_at, :updated_at, :type and :id.
# Note that this does not inherit from Base because it does not implement :created_at, :updated_at, :type and
# :id.

unvalidated true

Expand Down
3 changes: 2 additions & 1 deletion lib/ioki/model/passenger/estimation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ def self.schema_path
attribute :confidence, on: :read, type: :float
attribute :dropoff, on: :read, type: :object, model_class: CalculatedPoint
attribute :estimation_type, on: :read, type: :string
attribute :meta_data, on: :read, type: :object # Quote from the API docs: "Additional metadata about the estimation, no specified format (yet)"
# Quote from the API docs: "Additional metadata about the estimation, no specified format (yet)"
attribute :meta_data, on: :read, type: :object
attribute :pickup, on: :read, type: :object, model_class: CalculatedPoint
end
end
Expand Down
3 changes: 2 additions & 1 deletion lib/ioki/model/passenger/package.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ module Ioki
module Model
module Passenger
class Package < Ioki::Model::Base
# Note that this does not inherit from Base because it does not implement :created_at, :updated_at, :type and :id.
# Note that this does not inherit from Base because it does not implement :created_at, :updated_at, :type and
# :id.

def self.schema_path
'passenger_api--nested_service_credit_packages'
Expand Down
3 changes: 2 additions & 1 deletion lib/ioki/model/passenger/passenger_options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ module Ioki
module Model
module Passenger
class PassengerOptions < Ioki::Model::Base
# Note that this does not inherit from Base because it does not implement :type, :id, :created_at and :updated_at.
# Note that this does not inherit from Base because it does not implement :type, :id, :created_at and
# :updated_at.

unvalidated true # Specification not available.

Expand Down
3 changes: 2 additions & 1 deletion lib/ioki/model/passenger/phone_verification_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ module Model
module Passenger
class PhoneVerificationRequest < Base
attribute :phone_number, type: :string, on: :create
attribute :us_data_transfer_accepted, type: :bool, on: :create, unvalidated: true # The model does not return it but it's used when sending data to the server.
attribute :us_data_transfer_accepted, type: :bool, on: :create, unvalidated: true
# The model does not return it but it's used when sending data to the server.
end
end
end
Expand Down
3 changes: 2 additions & 1 deletion lib/ioki/model/passenger/ride.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ class Ride < Base
attribute :booking, type: :object, on: :read, model_class: Booking
attribute :pickup, type: :object, on: :read, model_class: CalculatedPoint
attribute :dropoff, type: :object, on: :read, model_class: CalculatedPoint
attribute :storage_spaces, type: :integer, on: [:read, :create, :update], omit_if_blank_on: [:create, :update], model_class: CalculatedPoint
attribute :storage_spaces, type: :integer, on: [:read, :create, :update], omit_if_blank_on: [:create, :update],
model_class: CalculatedPoint
attribute :book_for_others, type: :boolean, on: [:read, :create, :update]
attribute :cancellable, type: :boolean, on: [:read, :create, :update]
attribute :cancellation_reason, type: :string, on: [:read, :create, :update]
Expand Down
9 changes: 6 additions & 3 deletions lib/ioki/model/passenger/ride_inquiry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ module Ioki
module Model
module Passenger
class RideInquiry < Base
attribute :origin, type: :object, on: :create, model_class: RequestedPoint, unvalidated: true # The model does not return it but it's used when sending data to the server.
attribute :destination, type: :object, on: :create, model_class: RequestedPoint, unvalidated: true # The model does not return it but it's used when sending data to the server.
attribute :product_id, type: :string, on: :create, unvalidated: true # The model does not return it but it's used when sending data to the server.
# The model does not return it but it's used when sending data to the server.
attribute :origin, type: :object, on: :create, model_class: RequestedPoint, unvalidated: true
# The model does not return it but it's used when sending data to the server.
attribute :destination, type: :object, on: :create, model_class: RequestedPoint, unvalidated: true
# The model does not return it but it's used when sending data to the server.
attribute :product_id, type: :string, on: :create, unvalidated: true
attribute :assistances, on: :read, type: :array, model_class: Assistance
attribute :availability, on: :read, type: :object, model_class: Availability
attribute :constraints, on: :read, type: :object, model_class: Constraints
Expand Down
3 changes: 2 additions & 1 deletion lib/ioki/model/passenger/ride_passenger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ def self.specification_scope
attribute :type, on: [:create, :update], type: :string
attribute :bahncard, on: [:read, :create, :update], omit_if_blank_on: [:create, :update], type: :boolean
attribute :blue_badge, on: [:read, :create, :update], omit_if_blank_on: [:create, :update], type: :boolean
attribute :public_transport_ticket, on: [:read, :create, :update], omit_if_blank_on: [:create, :update], type: :boolean
attribute :public_transport_ticket, on: [:read, :create, :update], omit_if_blank_on: [:create, :update],
type: :boolean
attribute :walker, on: [:read, :create, :update], omit_if_blank_on: [:create, :update], type: :boolean
attribute :wheelchair, on: [:read, :create, :update], omit_if_blank_on: [:create, :update], type: :boolean
attribute :first_name, on: :read, type: :string
Expand Down
3 changes: 2 additions & 1 deletion lib/ioki/model/passenger/service_credit_options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ module Ioki
module Model
module Passenger
class ServiceCreditOptions < Ioki::Model::Base
# Note that this does not inherit from Base because it does not implement :created_at, :updated_at, :type and :id.
# Note that this does not inherit from Base because it does not implement :created_at, :updated_at, :type and
# :id.

def self.schema_path
'passenger_api--nested_service_credit_options'
Expand Down
6 changes: 4 additions & 2 deletions lib/ioki/model/platform/booking.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ module Model
module Platform
class Booking < Base
attribute :verification_code, type: :string, on: [:read, :update]
attribute :ride_version, type: :integer, on: :create, unvalidated: true # The model does not return it but it's used when sending data to the server.
attribute :payment_method, type: :object, on: :create, model_class: PaymentMethod, unvalidated: true # The model does not return it but it's used when sending data to the server.
# The model does not return it but it's used when sending data to the server.
attribute :ride_version, type: :integer, on: :create, unvalidated: true
# The model does not return it but it's used when sending data to the server.
attribute :payment_method, type: :object, on: :create, model_class: PaymentMethod, unvalidated: true
end
end
end
Expand Down
3 changes: 2 additions & 1 deletion lib/ioki/model/platform/constraints.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ module Ioki
module Model
module Platform
class Constraints < Ioki::Model::Base
# Note that this does not inherit from Base because it does not implement :created_at, :updated_at, :type and :id.
# Note that this does not inherit from Base because it does not implement :created_at, :updated_at, :type and
# :id.

unvalidated true

Expand Down
3 changes: 2 additions & 1 deletion lib/ioki/model/platform/estimation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ def self.schema_path
attribute :estimation_type, on: :read, type: :string
attribute :fare, on: :read, type: :object, model_class: Fare
attribute :links, on: :read, type: :array, model_class: RideInquiryLink
attribute :meta_data, on: :read, type: :object # Quote from the API docs: "Additional metadata about the estimation, no specified format (yet)"
# Quote from the API docs: "Additional metadata about the estimation, no specified format (yet)"
attribute :meta_data, on: :read, type: :object
attribute :pickup, on: :read, type: :object, model_class: CalculatedPoint
end
end
Expand Down
3 changes: 2 additions & 1 deletion lib/ioki/model/platform/fare.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ module Platform
class Fare < Base
attribute :booking_price_object, on: :read, type: :object, model_class: Money
attribute :booking_price_type, on: :read, type: :string
attribute :fare_details, on: :read, type: :object # The model_class is omitted because the API defines this as a generic JSON object.
# The model_class is omitted because the API defines this as a generic JSON object.
attribute :fare_details, on: :read, type: :object
attribute :fare_type, on: :read, type: :string
attribute :final_price_object, on: :read, type: :object, model_class: Money
attribute :personal_discount, on: :read, type: :object, model_class: PersonalDiscount
Expand Down
3 changes: 2 additions & 1 deletion lib/ioki/model/platform/passenger_options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ module Ioki
module Model
module Platform
class PassengerOptions < Ioki::Model::Base
# Note that this does not inherit from Base because it does not implement :type, :id, :created_at and :updated_at.
# Note that this does not inherit from Base because it does not implement :type, :id, :created_at and
# :updated_at.

unvalidated true # Specification not available.

Expand Down
6 changes: 4 additions & 2 deletions lib/ioki/model/platform/passenger_request_token.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ module Model
module Platform
class PassengerRequestToken < Base
attribute :token, type: :string, on: :read
attribute :user, type: :object, on: :read, model_class: User, unvalidated: true # The model does not return it but it's used when sending data to the server.
# The model does not return it but it's used when sending data to the server.
attribute :user, type: :object, on: :read, model_class: User, unvalidated: true
attribute :user_id, type: :string, on: [:create, :update]
attribute :client_identifier, type: :string, on: :create, unvalidated: true # The model does not return it but it's used when sending data to the server.
# The model does not return it but it's used when sending data to the server.
attribute :client_identifier, type: :string, on: :create, unvalidated: true
end
end
end
Expand Down
3 changes: 2 additions & 1 deletion lib/ioki/model/platform/ride.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ class Ride < Base
attribute :origin, type: :object, on: [:create, :read], model_class: RequestedPoint
attribute :destination, type: :object, on: [:create, :read], model_class: RequestedPoint
attribute :passengers, type: :array, on: [:create, :read], model_class: RidePassenger
attribute :user_id, type: :string, on: [:create, :update], unvalidated: true # The model does not return it but it's used when sending data to the server.
# The model does not return it but it's used when sending data to the server.
attribute :user_id, type: :string, on: [:create, :update], unvalidated: true
attribute :product_id, type: :string, on: [:read, :create, :update]
attribute :user, type: :object, on: :read, model_class: User
attribute :version, type: :integer, on: [:read, :update]
Expand Down
6 changes: 4 additions & 2 deletions lib/ioki/model/platform/ride_inquiry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ module Ioki
module Model
module Platform
class RideInquiry < Base
attribute :origin, on: :create, type: :object, model_class: RequestedPoint, unvalidated: true # The model does not return it but it's used when sending data to the server.
attribute :destination, on: :create, type: :object, model_class: RequestedPoint, unvalidated: true # The model does not return it but it's used when sending data to the server.
# The model does not return it but it's used when sending data to the server.
attribute :origin, on: :create, type: :object, model_class: RequestedPoint, unvalidated: true
# The model does not return it but it's used when sending data to the server.
attribute :destination, on: :create, type: :object, model_class: RequestedPoint, unvalidated: true
attribute :assistances, on: :read, type: :array, model_class: Assistance
attribute :availability, on: :read, type: :object, model_class: Availability
attribute :constraints, on: :read, type: :object, model_class: Constraints
Expand Down
3 changes: 2 additions & 1 deletion lib/ioki/model/platform/ride_inquiry_link.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ module Ioki
module Model
module Platform
class RideInquiryLink < Ioki::Model::Base
# Note that this does not inherit from Base because it does not implement :created_at, :updated_at, :type and :id.
# Note that this does not inherit from Base because it does not implement :created_at, :updated_at, :type and
# :id.

def self.schema_path
'platform_api--v20210101--ride_inquiry--links'
Expand Down
3 changes: 2 additions & 1 deletion lib/ioki/model/platform/ride_inquiry_link_android.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ module Ioki
module Model
module Platform
class RideInquiryLinkAndroid < Ioki::Model::Base
# Note that this does not inherit from Base because it does not implement :created_at, :updated_at, :type and :id.
# Note that this does not inherit from Base because it does not implement :created_at, :updated_at, :type and
# :id.

unvalidated true # No specification available.

Expand Down
3 changes: 2 additions & 1 deletion lib/ioki/model/platform/ride_inquiry_link_ios.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ module Ioki
module Model
module Platform
class RideInquiryLinkIos < Ioki::Model::Base
# Note that this does not inherit from Base because it does not implement :created_at, :updated_at, :type and :id.
# Note that this does not inherit from Base because it does not implement :created_at, :updated_at, :type and
# :id.

unvalidated true # No specification available.

Expand Down
3 changes: 2 additions & 1 deletion lib/ioki/model/platform/service_credit_charge.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ module Model
module Platform
class ServiceCreditCharge < Base
attribute :amount, on: :read, type: :object, model_class: Money
attribute :purchasable, on: :read, type: :object # The model_class is omitted because it can have one of several types.
# The model_class is omitted because it can have one of several types.
attribute :purchasable, on: :read, type: :object
attribute :state, on: :read, type: :string
end
end
Expand Down
Loading

0 comments on commit f8f89ab

Please sign in to comment.