Sha256: 0d55b06619620afb7a80a78c504e20bbcf6a4ff9ee7284827fae3769c5e3a539

Contents?: true

Size: 784 Bytes

Versions: 1

Compression:

Stored size: 784 Bytes

Contents

require "skala/adapter/operation/result"
require "skala/record"
require_relative "../get_records"

class Skala::Adapter::GetRecords::Result < Skala::Adapter::Operation::Result
  # This is the GetRecords::Result::Record, the object which holds meta informations
  # and has a record property, which holds the actual Skala::Record.
  class Record
    include Virtus.model

    attribute :found, Boolean, default: false
    attribute :id, String
    attribute :index, String
    attribute :record, Skala::Record
    attribute :type, String
    attribute :version, Integer
  end

  include Enumerable
  include Virtus.model

  attribute :records, Array[Record]
  attribute :source, String

  def each
    block_given? ? records.each { |_element| yield _element } : records.each
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
skala-1.1.0 lib/skala/adapter/get_records/result.rb