Class: Ferret::Index::SegmentInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/ferret/index/segment_infos.rb

Overview

Holds the info for one segment.

ToDo: Does the dir really need to be stored here?

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, doc_count, dir) ⇒ SegmentInfo

Returns a new instance of SegmentInfo.



9
10
11
12
13
# File 'lib/ferret/index/segment_infos.rb', line 9

def initialize(name, doc_count, dir)
  @name = name
  @doc_count = doc_count
  @directory = dir
end

Instance Attribute Details

#directoryObject

Returns the value of attribute directory.



7
8
9
# File 'lib/ferret/index/segment_infos.rb', line 7

def directory
  @directory
end

#doc_countObject

Returns the value of attribute doc_count.



7
8
9
# File 'lib/ferret/index/segment_infos.rb', line 7

def doc_count
  @doc_count
end

#nameObject

Returns the value of attribute name.



7
8
9
# File 'lib/ferret/index/segment_infos.rb', line 7

def name
  @name
end

Instance Method Details

#==(o) ⇒ Object



15
16
17
# File 'lib/ferret/index/segment_infos.rb', line 15

def ==(o)
  (o.name == @name and o.doc_count == @doc_count)
end