Sha256: 926635505909f9211b9abba292b3867788923365172a105d6e2ea36a19f61b41

Contents?: true

Size: 944 Bytes

Versions: 2

Compression:

Stored size: 944 Bytes

Contents

# frozen_string_literal: true

require_relative '../country'
require_relative '../region'

# declare country to avoid circular dependency
# rubocop:disable Style/ClassAndModuleChildren
class ONEAccess::DataObject::Country; end
class ONEAccess::DataObject::Representer::Country < Representable::Decorator; end
# rubocop:enable Style/ClassAndModuleChildren

module ONEAccess
  module DataObject
    module Representer
      class GlobalRegion < Representable::Decorator
        include Representable::JSON

        property :id, as: :Id, type: Integer
        property :name, as: :Name, type: String
        property :code, as: :Code, type: String
        property :description, as: :Description, type: String
        collection :countries, as: :Countries, decorator: Representer::Country, class: DataObject::Country
        collection :regions, as: :Regions, decorator: Representer::Region, class: DataObject::Region
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
oneaccess-1.3.1 lib/oneaccess/data_object/representer/global_region.rb
oneaccess-1.3.0 lib/oneaccess/data_object/representer/global_region.rb