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:



120
121
122
123
124
125
126
127
128
129
130
131
# File 'lib/ruby_event_store/client.rb', line 120

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.new(start) 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.



132
133
134
# File 'lib/ruby_event_store/client.rb', line 132

def count
  @count
end

#startObject (readonly)

Returns the value of attribute start.



132
133
134
# File 'lib/ruby_event_store/client.rb', line 132

def start
  @start
end