Class: TransactionEventStore::Client::Page

Inherits:
Object
  • Object
show all
Defined in:
lib/transaction_event_store/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(repository, start, count) ⇒ Page

Allow count to be nil to disable limit



47
48
49
50
51
52
53
54
55
56
57
# File 'lib/transaction_event_store/client.rb', line 47

def initialize(repository, start, count)
  if start.instance_of?(Symbol)
    raise InvalidPageStart unless [:head].include?(start)
  else
    start = start.to_s
    raise InvalidPageStart if start.empty?
    raise EventNotFound unless repository.has_event?(start)
  end
  @start = start
  @count = count
end

Instance Attribute Details

#countObject (readonly)

Returns the value of attribute count.



58
59
60
# File 'lib/transaction_event_store/client.rb', line 58

def count
  @count
end

#startObject (readonly)

Returns the value of attribute start.



58
59
60
# File 'lib/transaction_event_store/client.rb', line 58

def start
  @start
end