Class: RubyEventStore::Client::Page

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(repository, start, count) ⇒ Page

Returns a new instance of Page.

Raises:



94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/ruby_event_store/client.rb', line 94

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
  raise InvalidPageSize unless count > 0
  @start = start
  @count = count
end

Instance Attribute Details

#countObject (readonly)

Returns the value of attribute count.



106
107
108
# File 'lib/ruby_event_store/client.rb', line 106

def count
  @count
end

#startObject (readonly)

Returns the value of attribute start.



106
107
108
# File 'lib/ruby_event_store/client.rb', line 106

def start
  @start
end