From 6b697ed0e4881fa71c4bb54633b007142179ec52 Mon Sep 17 00:00:00 2001 From: Tobias Matz Date: Mon, 3 Jun 2024 13:52:36 +0200 Subject: [PATCH] Add OfferedSolution and PublicTransportStop model --- lib/ioki/model/operator/offered_solution.rb | 43 ++++++++++ .../model/operator/public_transport_stop.rb | 85 +++++++++++++++++++ 2 files changed, 128 insertions(+) create mode 100644 lib/ioki/model/operator/offered_solution.rb create mode 100644 lib/ioki/model/operator/public_transport_stop.rb diff --git a/lib/ioki/model/operator/offered_solution.rb b/lib/ioki/model/operator/offered_solution.rb new file mode 100644 index 00000000..40b6ba0f --- /dev/null +++ b/lib/ioki/model/operator/offered_solution.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +module Ioki + module Model + module Operator + class OfferedSolution < Base + attribute :type, + on: :read, + type: :string + + attribute :id, + on: :read, + type: :string + + attribute :created_at, + on: :read, + type: :date_time + + attribute :updated_at, + on: :read, + type: :date_time + + attribute :bookable, + on: :read, + type: :boolean + + attribute :solution_type, + on: :read, + type: :string + + attribute :fare, + on: :read, + type: :object, + class_name: 'Fare' + + attribute :hops, + on: :read, + type: :array, + class_name: 'Hop' + end + end + end +end diff --git a/lib/ioki/model/operator/public_transport_stop.rb b/lib/ioki/model/operator/public_transport_stop.rb new file mode 100644 index 00000000..3eb3c50e --- /dev/null +++ b/lib/ioki/model/operator/public_transport_stop.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +module Ioki + module Model + module Operator + class PublicTransportStop < Base + attribute :type, + on: :read, + type: :string + + attribute :city, + type: :string, + on: :read + + attribute :country, + type: :string, + on: :read + + attribute :county, + type: :string, + on: :read + + attribute :current_arrival, + type: :string, + on: :read + + attribute :current_departure, + type: :string, + on: :read + + attribute :current_platform, + type: :string, + on: :read + + attribute :dhid, + type: :string, + on: :read + + attribute :display_times, + type: :array, + on: :read + + attribute :hafas_ext_id, + type: :array, + on: :read + + attribute :lat, + type: :float, + on: :read + + attribute :lng, + type: :float, + on: :read + + attribute :location_name, + type: :array, + on: :read + + attribute :postal_code, + type: :array, + on: :read + + attribute :scheduled_arrival, + type: :string, + on: :read + + attribute :scheduled_departure, + type: :string, + on: :read + + attribute :scheduled_platform, + type: :string, + on: :read + + attribute :street_name, + type: :string, + on: :read + + attribute :street_number, + type: :string, + on: :read + end + end + end +end