Sha256: 45d6239ef970a4a3965c9d1f3f03fc5eb679b93d9917ea3d9bd22eb2236a2086

Contents?: true

Size: 675 Bytes

Versions: 1

Compression:

Stored size: 675 Bytes

Contents

# frozen_string_literal: true

module Tikkie
  module Api
    module V1
      module Responses
        # Response when requesting platforms (list).
        class Platforms < Base
          include Enumerable

          def each(&block)
            platforms.each(&block)
          end

          private

          def platforms
            @platforms ||= begin
              platforms = []

              unless error?
                data.each do |platform|
                  platforms << Tikkie::Api::V1::Responses::Platform.new(platform)
                end
              end

              platforms
            end
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tikkie-api-2.0.0 lib/tikkie/api/v1/responses/platforms.rb